Module: Runbook::Extensions::SSHConfig::DSL

Defined in:
lib/runbook/extensions/ssh_config.rb

Instance Method Summary collapse

Instance Method Details

#env(env) ⇒ Object



60
61
62
# File 'lib/runbook/extensions/ssh_config.rb', line 60

def env(env)
  parent.ssh_config[:env] = env
end

#group(group) ⇒ Object



56
57
58
# File 'lib/runbook/extensions/ssh_config.rb', line 56

def group(group)
  parent.ssh_config[:group] = group
end

#parallelization(strategy:, limit: 2, wait: 2) ⇒ Object



28
29
30
31
32
33
34
# File 'lib/runbook/extensions/ssh_config.rb', line 28

def parallelization(strategy: , limit: 2, wait: 2)
  parent.ssh_config[:parallelization] = {
    strategy: strategy,
    limit: limit,
    wait: wait,
  }
end

#path(path) ⇒ Object



48
49
50
# File 'lib/runbook/extensions/ssh_config.rb', line 48

def path(path)
  parent.ssh_config[:path] = path
end

#server(server) ⇒ Object



36
37
38
39
# File 'lib/runbook/extensions/ssh_config.rb', line 36

def server(server)
  parent.ssh_config[:servers].clear
  parent.ssh_config[:servers] << server
end

#servers(*servers) ⇒ Object



41
42
43
44
45
46
# File 'lib/runbook/extensions/ssh_config.rb', line 41

def servers(*servers)
  parent.ssh_config[:servers].clear
  servers.flatten.each do |server|
    parent.ssh_config[:servers] << server
  end
end

#ssh_config(&block) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/runbook/extensions/ssh_config.rb', line 15

def ssh_config(&block)
  config = Class.new do
    attr_reader :dsl
    prepend Runbook::Extensions::SSHConfig
  end.new
  dsl_class = Runbook::DSL.class(
    Runbook::Extensions::SSHConfig::DSL,
  )
  config.instance_variable_set(:@dsl, dsl_class.new(config))
  config.dsl.instance_eval(&block)
  config.ssh_config
end

#umask(umask) ⇒ Object



64
65
66
# File 'lib/runbook/extensions/ssh_config.rb', line 64

def umask(umask)
  parent.ssh_config[:umask] = umask
end

#user(user) ⇒ Object



52
53
54
# File 'lib/runbook/extensions/ssh_config.rb', line 52

def user(user)
  parent.ssh_config[:user] = user
end