Sha256: 278be1ff4ef05a5f0a5d949a467fcb15ab1a135f68ab4271b9cabd9f0dd51ed5

Contents?: true

Size: 1.03 KB

Versions: 1

Compression:

Stored size: 1.03 KB

Contents

require "optparse"
require "vagrant"

module VagrantPlugins
  module Orchestrate
    module Command
      class Push < Vagrant.plugin("2", :command)
        include Vagrant::Util

        def execute
          options = {}

          opts = OptionParser.new do |o|
            o.banner = "Usage: vagrant orchestrate push"
            o.separator ""

            o.on("--reboot", "Reboot a managed server after the provisioning step") do
              options[:reboot] = true
            end
          end

          # Parse the options
          argv = parse_options(opts)

          with_target_vms(argv, provider: :managed) do |machine|
            unless machine.name.to_s.start_with? "managed-"
              @logger.debug("Skipping machine #{machine.name}")
              next
            end

            machine.action(:up, options)
            machine.action(:provision, options)
            machine.action(:reload, options) if options[:reboot]
            machine.action(:destroy, options)
          end
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
vagrant-orchestrate-0.0.7 lib/vagrant-orchestrate/command/push.rb