Sha256: ef2d387caaffa8a40e87ba3aa3d0a3c5ec53ea9151a813323f93c325b8dbf5ca

Contents?: true

Size: 1.22 KB

Versions: 4

Compression:

Stored size: 1.22 KB

Contents

module VagrantPlugins
  module Invade
    module Generator
      module Section

        class Provision

          attr_accessor :machine_name, :name, :provision_data

          def initialize(machine_name, name, provision_data)
            @machine_name = machine_name
            @name = name
            @provision_data = provision_data
          end

          def generate
            case @provision_data['type']
            when 'shell'
              provision = Builder::Provision::Shell.new(@machine_name, @name, @provision_data)
            when 'shell-inline', 'inline', 'shellinline'
              provision = Builder::Provision::ShellInline.new(@machine_name, @name, @provision_data)
            when 'puppet', 'puppetapply', 'puppet-apply'
              provision = Builder::Provision::PuppetApply.new(@machine_name, @provision_data)
            when 'puppet-agent', 'puppetagent'
              provision = Builder::Provision::PuppetAgent.new(@machine_name, @provision_data)
            else
              raise StandardError, "Provisioner unknown or not set. Please check the provision configuration."
            end

            provision.build

            provision.result
          end

        end

      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
vagrant-invade-0.4.8 lib/vagrant-invade/generator/section/provision.rb
vagrant-invade-0.4.7 lib/vagrant-invade/generator/section/provision.rb
vagrant-invade-0.4.6 lib/vagrant-invade/generator/section/provision.rb
vagrant-invade-0.4.5 lib/vagrant-invade/generator/section/provision.rb