Sha256: 7a51f2155fbd30c6336fcbd8da6f11f6ee54097926bdf49b09bb66fd3891ce69

Contents?: true

Size: 891 Bytes

Versions: 1

Compression:

Stored size: 891 Bytes

Contents

module Vagabond
  module Actions
    module Provision
      def provision
        if(lxc.exists? && lxc.running?)
          do_provision
        else
          ui.fatal "LXC: Requested container: #{name} has not been created!"
        end
      end

      private

      def do_provision
        @ui.info "LXC: Provisioning #{name}..."
        com = "#{sudo}knife bootstrap #{lxc.container_ip(10, true)} -d chef-full -N #{name} -i /opt/hw-lxc-config/id_rsa "
        com << "--no-host-key-verify --run-list \"#{config[:run_list].join(',')}\" "
        if(config[:environment])
          com << "-E #{config[:environment]}"
        end
        if(Config[:knife_opts])
          com << Conifg[:knife_opts]
        end
        cmd = Mixlib::ShellOut.new(com, :live_stream => STDOUT)
        cmd.run_command
        @ui.info "LXC: Provisioning of #{name} complete!"
      end

    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
vagabond-0.1.0 lib/vagabond/actions/provision.rb