Exemple #1
0
    def install_postgis(self):
        for host in self.hosts.filter('master', 'slaves'):
            # Install projection library first
            host.run(wget(self.proj_download_url, 'proj.tgz'))
            host.run('tar xvzf proj.tgz')

            with host.cd('proj-4.*/'):
                host.run('./configure')
                host.run('make')
                host.sudo('make install')

            # Install Geos library
            host.run(wget(self.geos_download_url, 'geos.tar.bz2'))
            host.run('tar xvjf geos.tar.bz2')

            with host.cd('geos-3.3.*/'):
                host.run('./configure')
                host.run('make')
                host.sudo('make install')

            # Install postgis library
            host.run(wget(self.postgis_download_url, 'postgis.tgz'))
            host.run('tar xvzf postgis.tgz')

            with host.env('PATH', '/usr/local/pgsql/bin:$PATH', escape=False):
                with host.cd('postgis-1.5*/'):
                    host.run('./configure')
                    host.run('make')
                    host.sudo('make install')

            # For some reason, we are required to run ldconfig on Ubuntu,
            # otherwise, postgres might not find libgeos.so
            host.sudo('ldconfig')
Exemple #2
0
    def setup(self):
        # Also make sure that redis was not yet installed
        if self.is_already_installed:
            print 'Warning: Redis is already installed'
            if not confirm('Redis is already installed. Reinstall?'):
                return

        # Install dependencies
        self.packages.install()

        # Download, compile and install redis
        # If not yet installed
        if not self.host.has_command('redis-server'):
            # Download redis
            self.host.run(wget(self.redis_download_url, 'redis.tgz'))
            self.host.run('tar xvzf redis.tgz')

            # Unset ARCH variable, otherwise redis doesn't compile.
            # http://comments.gmane.org/gmane.linux.slackware.slackbuilds.user/6686
            with self.host.env('ARCH', ''):
                # Make and install
                with self.host.cd('redis-2.*'):
                    if self.host.is_64_bit:
                        self.host.run('make ARCH="-m64"')
                    else:
                        self.host.run('make 32bit')
                    self.host.sudo('make install')

        self.config.setup()

        # Install upstart config, and run
        self.upstart_service.setup()
        self.upstart_service.start()

        print 'Redis setup successfully on host'
Exemple #3
0
    def setup(self):
        # Also make sure that redis was not yet installed
        if self.is_already_installed:
            print 'Warning: Redis is already installed'
            if not self.console.confirm('Redis is already installed. Reinstall?', default=False):
                return

        # Install dependencies
        self.packages.install()

        # Download, compile and install redis
        # If not yet installed
        if not self.host.has_command('redis-server'):
            # Download redis
            self.host.run(wget(self.redis_download_url, 'redis.tgz'))
            self.host.run('tar xvzf redis.tgz')

            # Unset ARCH variable, otherwise redis doesn't compile.
            # http://comments.gmane.org/gmane.linux.slackware.slackbuilds.user/6686
            with self.host.env('ARCH', ''):
                # Make and install
                with self.host.cd('redis-2.*'):
                    if self.host.is_64_bit:
                        self.host.run('make ARCH="-m64"')
                    else:
                        self.host.run('make 32bit')
                    self.host.sudo('make install')

        self.config.setup()
        self.upstart_service.setup()
        self.touch_logfile()
Exemple #4
0
    def setup(self):
        """
        Do a bare postgres install.
        Normally you want to call configure_postgres after running this command.
        """
        # Install apt-get packages
        self.packages.install()

        # Install s3cmd for backups
        self.postgres_user.create()

        if self.s3_bucket:
            self.s3.setup()

        # Compile and install postgres
        for host in self.hosts.filter([ 'master', 'slaves' ]):
            host.run(wget(self.postgresql_download_url, 'postgresql.tgz'))
            host.run('tar xvzf postgresql.tgz')

            with host.cd('postgresql-9.1*/'):
                host.run('./configure')
                host.run('make')
                host.sudo('make install')

                # Compile hstore extension as well
                with host.cd('contrib/hstore'):
                    host.run('make')
                    host.sudo('make install')

        print "Don't forget to configure postgres. Probably you want to call 'configure_postgres' now."
Exemple #5
0
    def setup(self):
        # Also make sure that redis was not yet installed
        if self.is_already_installed:
            print 'Warning: Redis is already installed'
            return

        # Install dependencies
        self.packages.install()

        # Download, compile and install redis
        for h in self.hosts:
            # If not yet installed
            if not h.has_command('redis-server'):
                # Download redis
                h.run(wget(self.redis_download_url, 'redis.tgz'))
                h.run('tar xvzf redis.tgz')

                with h.cd('redis-2.*'):
                    if h.is_64_bit:
                    	h.run('make ARCH="-m64"')
                    else:
                    	h.run('make 32bit')
                    h.sudo('make install')

        self.config.setup()

        # Install upstart config, and run
        self.upstart_service.setup()
        self.upstart_service.start()

        print 'Redis setup successfully on host'
Exemple #6
0
 def install_dpkg_packages(self):
     for package in self.dpkg_packages:
         self.host.sudo(wget(package))
         self.host.sudo("dpkg -i '%s'" % esc1(package.split('/')[-1]))
Exemple #7
0
 def install_dpkg_packages(self):
     for package in self.dpkg_packages:
         self.host.sudo(wget(package))
         self.host.sudo("dpkg -i '%s'" % esc1(package.split('/')[-1]))