Sha256: 2a64328a1e42162d831437b998a133b0b050d805bbe2a0352b4e2d583ce00aa4

Contents?: true

Size: 1.33 KB

Versions: 15

Compression:

Stored size: 1.33 KB

Contents

module VagrantPlugins
  module Invade
    module Builder
      module Provision

        require 'erubis'

        class PuppetAgent

          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
            template_file = "#{TEMPLATE_PATH}/provision/puppet_agent.erb"

            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(template_file))
              @result = eruby.result b
            rescue TypeError, SyntaxError, SystemCallError => e
              raise(e)
            end
          end
        end

      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
vagrant-invade-0.5.5 lib/vagrant-invade/builder/provision/puppet_agent.rb
vagrant-invade-0.5.4 lib/vagrant-invade/builder/provision/puppet_agent.rb
vagrant-invade-0.5.3 lib/vagrant-invade/builder/provision/puppet_agent.rb
vagrant-invade-0.5.2 lib/vagrant-invade/builder/provision/puppet_agent.rb
vagrant-invade-0.5.1 lib/vagrant-invade/builder/provision/puppet_agent.rb
vagrant-invade-0.5.0 lib/vagrant-invade/builder/provision/puppet_agent.rb
vagrant-invade-0.4.8 lib/vagrant-invade/builder/provision/puppet_agent.rb
vagrant-invade-0.4.7 lib/vagrant-invade/builder/provision/puppet_agent.rb
vagrant-invade-0.4.6 lib/vagrant-invade/builder/provision/puppet_agent.rb
vagrant-invade-0.4.5 lib/vagrant-invade/builder/provision/puppet_agent.rb
vagrant-invade-0.4.4 lib/vagrant-invade/builder/provision/puppet_agent.rb
vagrant-invade-0.4.3 lib/vagrant-invade/builder/provision/puppet_agent.rb
vagrant-invade-0.4.2 lib/vagrant-invade/builder/provision/puppet_agent.rb
vagrant-invade-0.4.1 lib/vagrant-invade/builder/provision/puppet_agent.rb
vagrant-invade-0.4.0 lib/vagrant-invade/builder/provision/puppet_agent.rb