module VagrantPlugins::ManagedServers::Action

Public Class Methods

action_destroy() click to toggle source

This action is called to “unlink” vagrant from the managed server

# File lib/vagrant-managed-servers/action.rb, line 33
def self.action_destroy
  Vagrant::Action::Builder.new.tap do |b|
    b.use ConfigValidate
    b.use Call, IsLinked do |env, b2|
      if !env[:result]
        b2.use MessageNotLinked
        next
      end

      b2.use UnlinkServer
    end
  end
end
action_provision() click to toggle source

This action is called when `vagrant provision` is called.

# File lib/vagrant-managed-servers/action.rb, line 48
def self.action_provision
  Vagrant::Action::Builder.new.tap do |b|
    b.use ConfigValidate
    b.use WarnNetworks
    b.use Call, IsLinked do |env, b2|
      if !env[:result]
        b2.use MessageNotLinked
        next
      end

      b2.use Call, IsReachable do |env, b3|
        if !env[:result]
          b3.use MessageNotReachable
          next
        end

        b3.use Provision
        b3.use WarnWinRMSyncedFolders
        b3.use Vagrant::Action::Builtin::SyncedFolderCleanup
        b3.use Vagrant::Action::Builtin::SyncedFolders
      end
    end
  end
end
action_read_state() click to toggle source

This action is called to read the state of the machine. The resulting state is expected to be put into the `:machine_state_id` key.

# File lib/vagrant-managed-servers/action.rb, line 76
def self.action_read_state
  Vagrant::Action::Builder.new.tap do |b|
    b.use ConfigValidate
    b.use ReadState
  end
end
action_reload() click to toggle source
# File lib/vagrant-managed-servers/action.rb, line 128
def self.action_reload
  Vagrant::Action::Builder.new.tap do |b|
    b.use Call, IsLinked do |env, b2|
      if !env[:result]
        b2.use MessageNotLinked
        next
      end

      b2.use RebootServer
    end
  end
end
action_ssh() click to toggle source

This action is called to SSH into the machine.

# File lib/vagrant-managed-servers/action.rb, line 84
def self.action_ssh
  Vagrant::Action::Builder.new.tap do |b|
    b.use ConfigValidate
    b.use WarnNetworks
    b.use Call, IsLinked do |env, b2|
      if !env[:result]
        b2.use MessageNotLinked
        next
      end

      b2.use Call, IsReachable do |env, b3|
        if !env[:result]
          b3.use MessageNotReachable
          next
        end

        b3.use SSHExec
      end
    end
  end
end
action_ssh_run() click to toggle source
# File lib/vagrant-managed-servers/action.rb, line 106
def self.action_ssh_run
  Vagrant::Action::Builder.new.tap do |b|
    b.use ConfigValidate
    b.use WarnNetworks
    b.use Call, IsLinked do |env, b2|
      if !env[:result]
        b2.use MessageNotLinked
        next
      end

      b2.use Call, IsReachable do |env, b3|
        if !env[:result]
          b3.use MessageNotReachable
          next
        end

        b3.use SSHRun
      end
    end
  end
end
action_up() click to toggle source

This action is called to establish linkage between vagrant and the managed server

# File lib/vagrant-managed-servers/action.rb, line 12
def self.action_up
  Vagrant::Action::Builder.new.tap do |b|
    if Vagrant::VERSION < '1.5.0'
      b.use HandleBoxUrl
    else
      b.use HandleBox
    end
    b.use ConfigValidate
    b.use WarnNetworks
    b.use Call, IsLinked do |env, b2|
      if env[:result]
        b2.use MessageAlreadyLinked
        next
      end

      b2.use LinkServer
    end
  end
end