Cherry Servers Ansible collection for managing infrastructure and resources.
- ansible-core >= 2.14
- python >= 3.9
Use Ansible Galaxy CLI to install the collection:
ansible-galaxy collection install cherryservers.cloud
Before using the collection, you need to generate an API token from
the Cherry Servers client portal.
You can supply the token with the auth_token
attribute or by setting CHERRY_AUTH_TOKEN
(or CHERRY_AUTH_KEY
)
environment variables.
---
- name: Create a Cherry Servers server
hosts: localhost
tasks:
- name: Create a server
cherryservers.cloud.server:
project_id: 216063
region: "eu_nord_1"
plan: "cloud_vps_1"
auth_token: "my-auth-token-goes-here"
server
server_info
floating_ip
floating_ip_info
sshkey
sshkey_info
storage
storage_info
project
project_info
cherryservers
The full documentation can be found
on Ansible Galaxy.
Documentation for separate modules and plugins can also be accessed with ansible-doc
.
For example: ansible-doc cherryservers.cloud.server
will display documentation for the server
module.
The collection should be placed in the Ansible collection path, which is usually
~/.ansible/collections/ansible_collections/<namespace>/collection
.
You can either clone the repository there directly, or, clone the repository anywhere, build with
ansible-galaxy collection build
(from the collection directory)
and install with ansible-galaxy collection install <path-to-collection-file>
.
For more information, refer to Ansible documentation on collection development.
Testing can be done with ansible-test
. For example, to launch sanity tests, you can use:
ansible-test sanity --docker default -v
To perform integration tests, an integration_config.yml
file must be created in the tests/integration/
directory.
This file must declare cherryservers_api_key
, cherryservers_project_id
and, optionally,
cherryservers_baremetal_server_id
(used for storage testing).
You can run the whole suite of integration tests with, for example:
ansible-test integration --docker fedora39 -vvv
You can also run integration tests for specific modules, for example:
ansible-test integration server --docker fedora39 -vvv
More information on Ansible collection testing can be found here.
See the changelog.
- Update
_VERSION
inplugins/module_utils/_version.py
. - Update version in
galaxy.yml
. - Run
antsibull-changelog release
(make sureantsibull-changelog
is installed.) - If there are new modules or plugins, update the Included content section of this document.
- Tag the new version and push it.