Class: VagrantBolt::ConfigBuilder::Triggers
- Inherits:
-
Config
- Object
- ConfigBuilder::Model::Base
- Config
- VagrantBolt::ConfigBuilder::Triggers
- Defined in:
- lib/vagrant-bolt/config_builder/triggers.rb
Instance Attribute Summary collapse
-
#trigger_commands ⇒ Array<Symbol>
The commands that the trigger should run on.
-
#trigger_type ⇒ Symbol
A symbol containing the the trigger action.
Attributes inherited from Config
#args, #bolt_exe, #boltdir, #command, #connect_timeout, #debug, #excludes, #facts, #features, #host_key_check, #machine_alias, #machine_name, #modulepath, #name, #node_list, #nodes, #noop, #params, #password, #port, #private_key, #project, #run_as, #ssl, #ssl_verify, #sudo_password, #target_list, #targets, #tmpdir, #user, #vars, #verbose
Instance Method Summary collapse
Instance Attribute Details
#trigger_commands ⇒ Array<Symbol>
Returns The commands that the trigger should run on. E.g. [:up, :provision]
.
13 |
# File 'lib/vagrant-bolt/config_builder/triggers.rb', line 13 def_model_attribute :trigger_commands |
#trigger_type ⇒ Symbol
Returns A symbol containing the the trigger action. Valid values are :before
and :after
.
9 |
# File 'lib/vagrant-bolt/config_builder/triggers.rb', line 9 def_model_attribute :trigger_type |
Instance Method Details
#to_proc ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/vagrant-bolt/config_builder/triggers.rb', line 15 def to_proc = @attrs.dup trigger_type = .delete(:trigger_type) trigger_commands = .delete(:trigger_commands) command = .delete(:command) name = .delete(:name) proc do |config| config.trigger.send(trigger_type, trigger_commands) do |trigger| trigger.ruby do |env, machine| VagrantBolt.send(command, name, env, machine, **) end end end end |