Sha256: ceccc7d41421087bbbb0c2786e856f2be5cfe479f4d65002e893acc35a042a69

Contents?: true

Size: 1.27 KB

Versions: 7

Compression:

Stored size: 1.27 KB

Contents

module VagrantPlugins
  module Invade
    module InvadeModule
      module Provision

        class PuppetAgent <  InvadeModule

          attr_reader :result
          attr_accessor :machine_name, :puppet_agent_data

          def initialize(machine_name, puppet_agent_data, result: nil)
            @machine_name = machine_name
            @puppet_agent_data = puppet_agent_data
            @result = result
          end

          def build
            b = binding

            begin

              # Get machine name
              machine_name = @machine_name

              # Values for provider puppet_agent section
              puppet_server = @puppet_agent_data['puppet_server']
              puppet_node = @puppet_agent_data['puppet_node']
              client_cert_path = @puppet_agent_data['client_cert_path']
              client_private_key_path = @puppet_agent_data['client_private_key_path']
              facter = @puppet_agent_data['facter']
              options = @puppet_agent_data['options']

              eruby = Erubis::Eruby.new(File.read(self.get_template_path(__FILE__)))
              @result = eruby.result b
            rescue TypeError, SyntaxError, SystemCallError => e
              raise(e)
            end
          end
        end

      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
vagrant-invade-0.8.0 lib/vagrant-invade/module/provision/puppet_agent/puppet_agent.rb
vagrant-invade-0.7.0 lib/vagrant-invade/module/provision/puppet_agent/puppet_agent.rb
vagrant-invade-0.6.4 lib/vagrant-invade/module/provision/puppet_agent/puppet_agent.rb
vagrant-invade-0.6.3 lib/vagrant-invade/module/provision/puppet_agent/puppet_agent.rb
vagrant-invade-0.6.2 lib/vagrant-invade/module/provision/puppet_agent/puppet_agent.rb
vagrant-invade-0.6.1 lib/vagrant-invade/module/provision/puppet_agent/puppet_agent.rb
vagrant-invade-0.6.0 lib/vagrant-invade/module/provision/puppet_agent/puppet_agent.rb