stonith / chef-provisioner

A gem to bootstrap against a chef-zero server

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

travis badge

Chef zero bootstrap

This is a simple client to bootstrap against a chef-zero server

At the minimum

require 'chef-provisioner'

ChefProvisioner::Config.setup(server: 'https://my.awesome.chef.server', client_key_path: client_pem_path, client: 'your_client_name')

script = ChefProvisioner::Bootstrap.generate(
  node_name: 'foo.bar.mydomain'
)

File.write('./my_script', script)
system('./my_script')

The resulting file (my_script above) may be executed to bootstrap the server in question

You may (and should) also specify other attributes:

script = ChefProvisioner::Bootstrap.generate(
  node_name: 'foo.bar.mydomain',
  environment: 'master',
  first_boot: {
    run_list: [ 'role[my-sweet-role]' ]
  }
)

Note:

  • first_boot will automatically get 'fqdn' set to 'node_name'
  • The bootstrap server is set automatically from the Chef endpoint
  • Node names are trimmed of leading and trailing whitespace

About

A gem to bootstrap against a chef-zero server


Languages

Language:Ruby 92.8%Language:Shell 7.2%