Module: Phase::DSL
- Defined in:
- lib/phase/dsl.rb
Instance Method Summary collapse
-
#on(destination_ips, options = {}, &block) ⇒ Object
def on_role(role_name, options = {}, &block) destination_ips = [] on(destination_ips, options, &block) end.
- #run_locally(&block) ⇒ Object
Instance Method Details
#on(destination_ips, options = {}, &block) ⇒ Object
def on_role(role_name, options = {}, &block)
destination_ips = []
on(destination_ips, , &block)
end
9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/phase/dsl.rb', line 9 def on(destination_ips, = {}, &block) bastion_host = ["[email protected]"] coordinator = SSH::Coordinator.new(bastion_host) destination_ips.each do |ip| coordinator.each() do on_remote_host(ip) { instance_exec(&block) } end end end |
#run_locally(&block) ⇒ Object
21 22 23 |
# File 'lib/phase/dsl.rb', line 21 def run_locally(&block) ::SSHKit::Backend::Local.new(&block).run end |