Sha256: ba110ebd8813ed3070f3206061e8b5e8a260d5169bea6cf9c49fd3823a3118c1

Contents?: true

Size: 1.41 KB

Versions: 6

Compression:

Stored size: 1.41 KB

Contents

module PoolParty
  module Provisioner
    class Slave < ProvisionerBase

      def install_tasks
        [ 
          setup_puppet,
          setup_configs,
          run_once_and_clean
        ] << configure_tasks
      end

      def configure_tasks
        [          
          start_puppet
        ]
      end

      def setup_puppet
        <<-EOE
          if [ -z "$(grep -v '#' /etc/hosts | grep 'master')" ]; then echo "#{master_ip} puppet master" >> /etc/hosts; else echo "host already set"; fi
          cp #{Base.remote_storage_path}/namespaceauth.conf /etc/puppet/namespaceauth.conf
        EOE
      end

      def setup_configs
        <<-EOS          
          echo "#{open(File.join(template_directory, "puppet.conf")).read}" > /etc/puppet/puppet.conf
          /etc/init.d/puppetmaster stop #{unix_hide_string}
          # /usr/bin/puppetrerun
        EOS
      end
      
      def run_once_and_clean
        <<-EOS
. /etc/profile && /usr/sbin/puppetd --onetime --no-daemonize --logdest syslog --server master #{unix_hide_string}
rm -rf /etc/puppet/ssl
        EOS        
      end

      # /etc/init.d/puppetmasterd stop
      # puppetd --listen --fqdn #{@instance.name}
      def start_puppet
        <<-EOS
. /etc/profile && /usr/sbin/puppetd --onetime --no-daemonize --logdest syslog --server master #{unix_hide_string}
        EOS
      end
      
      def master_ip
        @cloud.master.ip
      end

    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
auser-poolparty-0.2.46 lib/poolparty/helpers/provisioners/slave.rb
auser-poolparty-0.2.47 lib/poolparty/helpers/provisioners/slave.rb
auser-poolparty-0.2.48 lib/poolparty/helpers/provisioners/slave.rb
auser-poolparty-0.2.49 lib/poolparty/helpers/provisioners/slave.rb
auser-poolparty-0.2.50 lib/poolparty/helpers/provisioners/slave.rb
auser-poolparty-0.2.51 lib/poolparty/helpers/provisioners/slave.rb