Exemple #1
0
 def install(self):
     if self.is_db_installed():
         print 'Database already installed'
         return
     password = generate_password()
     sudo('debconf-set-selections <<< "mysql-server-5.5 mysql-server/root_password password %s"' % password)
     sudo('debconf-set-selections <<< "mysql-server-5.5 mysql-server/root_password_again password %s"' % password)
     add_os_package(' '.join(['mysql-server'] + self.required_system_packages))
     local('touch passwords')
     return password
def setup_server(local=False):
    """ WARNING: under development """
    with settings(warn_only=True):
        sudo('apt-get update')
    add_os_package(' '.join(REQUIRED_SYSTEM_PACKAGES))
    server_setup_info = ['-'*80, 'Server setup for %s' % env.host]
    #if not local:
    #    password = add_user(PRODUCTION_USER, True)
    #    if password:
    #        server_setup_info.append('www user password: %s' % password)
    db_type_class = select_db_type()
    if db_type_class:
        db = db_type_class()
        db_password = db.install()
        if db_password:
            server_setup_info.append('Database Root Password: %s' % db_password)
    sudo('reboot') # FIX ME: add check for is reboot required
    print '\n'.join(server_setup_info)
Exemple #3
0
 def install(self):
     if self.is_db_installed():
         print 'Database already installed'
         return
     add_os_package('postgresql')