Sha256: ad9d9269ba560b790cd9aaa0394da56d0257edd178b83cbfc7313092c61df1a7

Contents?: true

Size: 972 Bytes

Versions: 2

Compression:

Stored size: 972 Bytes

Contents

module PoolParty
  module Provisioner
    class Slave < ProvisionerBase

      def install_tasks
        [ 
          setup_puppet
        ] << configure_tasks
      end

      def configure_tasks
        [
          setup_configs,
          start_puppet
        ]
      end

      def setup_puppet
        <<-EOE
          puppetd --mkusers
          if [ -z "$(grep -v '#' /etc/hosts | grep 'puppet')" ]; then echo "#{master_ip} puppet" >> /etc/hosts; else echo "host already set"; fi
          mv #{Base.remote_storage_path}/#{Base.tmp_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        
        EOS
      end

      def start_puppet
        <<-EOS
puppetd --listen --fqdn=#{@instance.name}
        EOS
      end
      
      def master_ip
        @cloud.master.ip
      end

    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
auser-poolparty-0.2.4 lib/poolparty/helpers/provisioners/slave.rb
auser-poolparty-0.2.5 lib/poolparty/helpers/provisioners/slave.rb