Method: Formatron::Chef::SSH#run_chef_client

Defined in:
lib/formatron/chef/ssh.rb

#run_chef_client(hostname:, bastion_hostname:) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/formatron/chef/ssh.rb', line 13

def run_chef_client(hostname:, bastion_hostname:)
  # use the first-boot.json to ensure the runlist is correct
  # if the node fails to converge the first time (in which case
  # the server will show an empty run list for the node)
  Formatron::Util::SSH.exec(
    hostname: hostname,
    bastion_hostname: bastion_hostname,
    user: SSH_USER,
    key: @keys.ec2_key,
    command: 'sudo chef-client -j /etc/chef/first-boot.json'
  )
end