Module: VagrantPlugins::AWS::Action

Includes:
Vagrant::Action::Builtin
Defined in:
lib/vagrant-aws/action.rb,
lib/vagrant-aws/action/is_created.rb,
lib/vagrant-aws/action/read_state.rb,
lib/vagrant-aws/action/connect_aws.rb,
lib/vagrant-aws/action/run_instance.rb,
lib/vagrant-aws/action/sync_folders.rb,
lib/vagrant-aws/action/read_ssh_info.rb,
lib/vagrant-aws/action/warn_networks.rb,
lib/vagrant-aws/action/timed_provision.rb,
lib/vagrant-aws/action/terminate_instance.rb,
lib/vagrant-aws/action/message_not_created.rb,
lib/vagrant-aws/action/message_already_created.rb

Defined Under Namespace

Classes: ConnectAWS, IsCreated, MessageAlreadyCreated, MessageNotCreated, ReadSSHInfo, ReadState, RunInstance, SyncFolders, TerminateInstance, TimedProvision, WarnNetworks

Class Method Summary collapse

Class Method Details

.action_destroyObject

This action is called to terminate the remote machine.



12
13
14
15
16
17
18
# File 'lib/vagrant-aws/action.rb', line 12

def self.action_destroy
  Vagrant::Action::Builder.new.tap do |b|
    b.use ConfigValidate
    b.use ConnectAWS
    b.use TerminateInstance
  end
end

.action_provisionObject

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



21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/vagrant-aws/action.rb', line 21

def self.action_provision
  Vagrant::Action::Builder.new.tap do |b|
    b.use ConfigValidate
    b.use Call, IsCreated do |env, b2|
      if !env[:result]
        b2.use MessageNotCreated
        next
      end

      b2.use Provision
      b2.use SyncFolders
    end
  end
end

.action_read_ssh_infoObject

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



39
40
41
42
43
44
45
# File 'lib/vagrant-aws/action.rb', line 39

def self.action_read_ssh_info
  Vagrant::Action::Builder.new.tap do |b|
    b.use ConfigValidate
    b.use ConnectAWS
    b.use ReadSSHInfo
  end
end

.action_read_stateObject

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.



50
51
52
53
54
55
56
# File 'lib/vagrant-aws/action.rb', line 50

def self.action_read_state
  Vagrant::Action::Builder.new.tap do |b|
    b.use ConfigValidate
    b.use ConnectAWS
    b.use ReadState
  end
end

.action_sshObject

This action is called to SSH into the machine.



59
60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/vagrant-aws/action.rb', line 59

def self.action_ssh
  Vagrant::Action::Builder.new.tap do |b|
    b.use ConfigValidate
    b.use Call, IsCreated do |env, b2|
      if !env[:result]
        b2.use MessageNotCreated
        next
      end

      b2.use SSHExec
    end
  end
end

.action_upObject

This action is called to bring the box up from nothing.



74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# File 'lib/vagrant-aws/action.rb', line 74

def self.action_up
  Vagrant::Action::Builder.new.tap do |b|
    b.use ConfigValidate
    b.use ConnectAWS
    b.use Call, IsCreated do |env, b2|
      if env[:result]
        b2.use MessageAlreadyCreated
        next
      end

      b2.use TimedProvision
      b2.use SyncFolders
      b2.use WarnNetworks
      b2.use RunInstance
    end
  end
end