This recipe installs an ohai plugin on your machine to use the
metadata of your Scaleway server in your recipes. It that will
populate node[scw]
with the content of scw-metadata
.
- Scaleway hardware, Linux
- Chef 12.0 or later
ohai
- ohai-scaleway needs theohai
cookbook to install the plugin
This cookbook can't be configured with any attribute, but the ohai
plugin exports many automatic attributes. It exports any item returned
by the scw-metadata
util, with the key in lowercase. Useful
attributes include:
name
: The name of the serverpublic_ip_address
: The public IP of your serverprivate_ip
: The private IP address of your serverssh_public_keys
: The public keys defined in your accountcommercial_type
: 'C1' or 'VC1M' for exampleipv6_address
ipv6_netmask
ipv6_gateway
Include ohai-scaleway
in your node's run_list
:
{
"name":"my_node",
"run_list": [
"recipe[ohai-scaleway]"
]
}
Then, to avoid reloading ohai at every-run, add the plugin folder into
the ohai.plugin_path
(can bet set in chef-client.rb) The plugin is
installed in the ohai/plugins
folder of your chef conf folder
(usually /etc/chef). .
On standard setup, you can just add ohai.plugin_path << '/etc/chef/ohai/plugins'
to /etc/chef/chef-client.rb
(or Ohai::Config[:plugin_path] << '/etc/chef/ohai/plugins'
on older versions)
e.g.
- Fork the repository on Github
- Create a named feature branch (like
add_component_x
) - Write your change
- Write tests for your change (if applicable)
- Run the tests, ensuring they all pass
- Submit a Pull Request using Github
This code is provided with ABSOLUTELY NO WARRANTY under the 'Do What the Fuck You Want to Public License (WTFPL)'
Authors:
- Julien
Lta
BALLET <contact 'AT' lta.io>