Introduction
Last updated
Last updated
Chef is a popular configuration management tool that allows simplified configuration and maintenance of both servers and cloud provider environments through the use of common templates called recipes. The Chef knife
command line tool allows management of various nodes within those environments. The knife-ionoscloud
plugin utilizes the IONOS Cloud REST API to provision and manage various cloud resources on the IONOS Cloud platform.
An IONOS account is required for access to the Cloud API; credentials from your registration are used to authenticate against the IONOS Cloud API.
The knife-ionoscloud
plugin can be installed as a gem:
Or the plugin can be installed by adding the following line to your application's Gemfile:
And then execute:
The Ionoscloud account credentials can be added to the knife.rb
configuration file.
If a virtual data center has already been created under the Ionoscloud account, then the data center UUID can be added to the knife.rb
which reduces the need to include the --datacenter-id [datacenter_id]
parameter for each action within the data center.
The configuration parameters can also be passed using shell environment variables. First, the following should be added to the knife.rb
configuration file:
Now the parameters can be set as environment variables:
Instead of using username and password to authenticate, one can a Ionoscloud access token, setting it using the :ionoscloud_token argument:.
Be aware that setting the token makes the username and password be ignored, in order to use the username and password one must unset the token value.
In order to make passing JSON or array arguments easier, we allow you to specify a file which holds the arguments for a command. This is done with the --extra-config EXTRA_CONFIG_FILE_PATH
or -e EXTRA_CONFIG_FILE_PATH
. The file is expected to contain a JSON which should map the name of arguments to their expected values. Here is an example of such a file.
When using the command knife ionoscloud datacenter create --extra-config EXTRA_CONFIG_FILE_PATH
where EXTRA_CONFIG_FILE_PATH is the name of the file containing the JSON above, the arguments described in the file will be used.
If any of the arguments are set in any other way, the values from the file will be ignored. Running the command knife ionoscloud datacenter create --location us/las --extra-config EXTRA_CONFIG_FILE_PATH
will create a datacenter in the 'us/las' location. In the same way if the values for ionoscloud_username and ionoscloud_password are already set in the knife.rb file, the contents from the JSON will be ignored.
Only Ionoscloud specific options may be altered using this option.
If an option is ignored because it is not on the available options list or if it is overwritten in another way then a warning message will be displayed.
By changing API url the module will make all calls using the provided url. To change the API url used by the knife module, one can do either of the following:
specify the new url using --url NEW_URL
set it in a json file, using the ionoscloud_url
key, and passing the file to the command like described in the section above
set the new url in the knife.rb file. It could be set using an environmental variable, same as with the username and the password.
The IONOS Cloud plugin for Knife aims to offer access to all resources in the IONOS Cloud API and also offers some additional features that make the integration easier:
authentication for API calls
handling of asynchronous requests
How can I open a bug/feature request?
Bugs & feature requests can be open on the repository issues: https://github.com/ionos-cloud/knife-ionos-cloud/issues/new/choose