Module: Phase::DSL

Defined in:
lib/phase/dsl.rb

Instance Method Summary collapse

Instance Method Details

#on(destination_ips, options = {}, &block) ⇒ Object

def on_role(role_name, options = {}, &block)

destination_ips = []
on(destination_ips, options, &block)

end



9
10
11
12
13
14
15
16
17
18
19
# File 'lib/phase/dsl.rb', line 9

def on(destination_ips, options = {}, &block)
  bastion_host = ["[email protected]"]

  coordinator = SSH::Coordinator.new(bastion_host)

  destination_ips.each do |ip|
    coordinator.each(options) 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