コード例 #1
0
ファイル: mysql.py プロジェクト: amitsrivastav/serverstuffs
def mysql_install():
    """ Installs mysql. """
    if _mysql_is_installed():
        puts('Mysql is already installed.')
        return

    passwd = _get_root_password()

    # this way mysql won't ask for a password on installation
    # see http://serverfault.com/questions/19367/scripted-install-of-mysql-on-ubuntu
    os = utils.detect_os()
    system.aptitude_install('debconf-utils')

    mysql_versions = {'lenny': '5.0', 'squeeze': '5.1', 'maverick': '5.1'}
    version = mysql_versions[os]

    debconf_defaults = [
        "mysql-server-%s mysql-server/root_password_again password %s" % (version, passwd),
        "mysql-server-%s mysql-server/root_password password %s" % (version, passwd),
    ]

    sudo("echo '%s' | debconf-set-selections" % "\n".join(debconf_defaults))

    warn('\n=========\nThe password for mysql "root" user will be set to "%s"\n=========\n' % passwd)
    system.aptitude_install('mysql-server')
コード例 #2
0
ファイル: mysql.py プロジェクト: agarwal-karan/serverstuffs
def mysql_install():
    """ Installs mysql. """
    if _mysql_is_installed():
        puts('Mysql is already installed.')
        return

    passwd = _get_root_password()

    # this way mysql won't ask for a password on installation
    # see http://serverfault.com/questions/19367/scripted-install-of-mysql-on-ubuntu
    os = utils.detect_os()
    system.aptitude_install('debconf-utils')

    mysql_versions = {'lenny': '5.0', 'squeeze': '5.1', 'maverick': '5.1'}
    version = mysql_versions[os]

    debconf_defaults = [
        "mysql-server-%s mysql-server/root_password_again password %s" %
        (version, passwd),
        "mysql-server-%s mysql-server/root_password password %s" %
        (version, passwd),
    ]

    sudo("echo '%s' | debconf-set-selections" % "\n".join(debconf_defaults))

    warn(
        '\n=========\nThe password for mysql "root" user will be set to "%s"\n=========\n'
        % passwd)
    system.aptitude_install('mysql-server')
コード例 #3
0
ファイル: apache.py プロジェクト: mukgupta/django-fast-deploy
    def install(self, confirm=True):
        """ Installs apache. """
        system.aptitude_install('apache2 libapache2-mod-wsgi libapache2-mod-rpaf locales-all')
        self.setup_locale()

        default_sites = [
            '/etc/apache2/sites-enabled/default',
            '/etc/apache2/sites-enabled/000-default',
        ]

        for site in default_sites:
            if files.exists(site, use_sudo=True):
                msg = "Remote %s will be deleted.\n" \
                      "This is necessary for django-fab-deploy to work.\n" \
                      "Choose 'n' and do a backup if you have customized this file.\n"\
                      "Do you wish to continue?"  % site
                if not confirm or console.confirm(msg):
                    sudo('rm -f %s' % site)
                else:
                    abort("Aborting.")


        if _ports_conf_needs_disabling():
            msg = "The contents of remote %s will be erased.\n"\
                  "This is necessary for django-fab-deploy to work.\n" \
                  "Choose 'n' and do a backup if you have customized this file.\n" \
                  "Do you wish to continue?" % APACHE_PORTS_FILE
            if not confirm or console.confirm(msg):
                _disable_ports_conf()
            else:
                abort("Aborting.")
コード例 #4
0
 def install(self):
     """ Installs PostgreSQL + postgis. """
     os = utils.detect_os()
     if os == "trusty":
         packages = 'gdal-bin postgresql-9.3 postgresql-9.3-postgis-2.1 postgresql-server-dev-9.3'
     else:
         packages = 'gdal-bin postgresql-8.4-postgis postgresql-server-dev-8.4'
     system.aptitude_install(packages)
コード例 #5
0
 def install(self):
     """ Installs postgresql. """
     os = utils.detect_os()
     if os == "trusty":
         packages = 'postgresql-server-dev-9.3 postgresql-9.3'
     else:
         packages = 'postgresql-server-dev-8.4 postgresql-8.4'
     system.aptitude_install(packages)
コード例 #6
0
ファイル: __init__.py プロジェクト: RaD/prodjector
def deploy_prepare():
    u"""
    Подготовка удалённого сервера к установке ПО.
    """
    print deploy_prepare.__doc__
    # устанавливаем sudo, настраиваем backports
    system.prepare_server()

    # создаём виртуальное окружение
    virtualenv.virtualenv_create()

    # устанавливаем APT и PIP пакеты
    packages = ' '.join(APT)
    system.aptitude_install(packages)
    packages = ' '.join(PIP)
    pip_install(packages)

    # устанавливаем общие зависимости
    put('./reqs', '~/')
    pip_install('-r reqs/apps.txt')

    # перекидываем код на сервер
    rsync_codebase()
コード例 #7
0
def apache_install():
    """ Installs apache. """
    system.aptitude_install('apache2 libapache2-mod-wsgi libapache2-mod-rpaf')
    sudo('rm -f /etc/apache2/sites-enabled/default')
    sudo('rm -f /etc/apache2/sites-enabled/000-default')
    apache_setup_locale()
コード例 #8
0
ファイル: apache.py プロジェクト: amitsrivastav/serverstuffs
def apache_install():
    """ Installs apache. """
    system.aptitude_install('apache2 libapache2-mod-wsgi libapache2-mod-rpaf')
    sudo('rm -f /etc/apache2/sites-enabled/default')
    sudo('rm -f /etc/apache2/sites-enabled/000-default')
    apache_setup_locale()
コード例 #9
0
ファイル: nginx.py プロジェクト: agarwal-karan/serverstuffs
def nginx_install():
    """ Installs nginx. """
    os = utils.detect_os()
    options = {'lenny': '-t lenny-backports'}
    system.aptitude_install('nginx', options.get(os, ''))
    sudo('rm -f /etc/nginx/sites-enabled/default')
コード例 #10
0
ファイル: nginx.py プロジェクト: amitsrivastav/serverstuffs
def nginx_install():
    """ Installs nginx. """
    os = utils.detect_os()
    options = {'lenny': '-t lenny-backports'}
    system.aptitude_install('nginx', options.get(os, ''))
    sudo('rm -f /etc/nginx/sites-enabled/default')
コード例 #11
0
def java_install():
    ''' Installs JRE '''
    aptitude_install('default-jre')
コード例 #12
0
def php_cli_install():
    ''' Installs php5 CLI'''
    aptitude_install('php5-cli')
コード例 #13
0
def php_gd_install():
    ''' Installs gd for php5'''
    aptitude_install('php5-gd')
コード例 #14
0
def imagemagick_install():
    """ Installs Image Magick """
    os = utils.detect_os()
    options = {'squeeze': '-t squeeze-backports'}
    system.aptitude_install('imagemagick', options.get(os, ''))
コード例 #15
0
def java_install():
    ''' Installs JRE '''
    aptitude_install('default-jre')
コード例 #16
0
def redis_install():
    """ Installs Redis """
    os = utils.detect_os()
    options = {'squeeze': '-t squeeze-backports'}
    system.aptitude_install('redis-server', options.get(os, ''))
コード例 #17
0
def imagemagick_install():
    """ Installs Image Magick """
    os = utils.detect_os()
    options = {'squeeze': '-t squeeze-backports'}
    system.aptitude_install('imagemagick', options.get(os, ''))
コード例 #18
0
def sphinx_install():
    """ Install sphinx search """
    aptitude_install('sphinxsearch')
    sudo('sed -i "s/START=no/START=yes/g" /etc/default/sphinxsearch')
コード例 #19
0
def redis_install():
    """ Installs Redis """
    os = utils.detect_os()
    options = {'squeeze': '-t squeeze-backports'}
    system.aptitude_install('redis-server', options.get(os, ''))