Class: Seedee::Chef

Inherits:
Object
  • Object
show all
Defined in:
lib/seedee/chef.rb

Overview

Talk to Chef Server

Instance Method Summary collapse

Instance Method Details

#bootstrap(droplet, node_name, recipes) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/seedee/chef.rb', line 6

def bootstrap(droplet, node_name, recipes)
  run_list = "recipe[#{Array(recipes).join(' ')}]"

  command = <<~COMMAND
    #{File.join('knife')} bootstrap #{droplet.public_ip} \
      --ssh-user #{ssh_user} \
      --sudo \
      --node-name #{node_name.to_s.strip} \
      --run-list '#{run_list}' \
      --ssh-identity-file #{ssh_identity_file} \
      --yes
  COMMAND

  system(command)
end