These are additional, unofficial Ansible modules for managing servers at CloudAtCost
- cac_server.py
-
Module for managing cloudatcost servers in your playbooks
- cac_inv.py
-
Cloudatcost Inventory script
git clone https://github.com/sage905/cloudatcost-ansible-module
cd cloudatcost-ansible-module
pip install cloudatcost-ansible-module
git clone https://github.com/sage905/cloudatcost-ansible-module
ln -s $PWD/cloudatcost-ansible-module/cloudatcost-ansible-module/cac_server.py /path/to/your/ansible/library
ln -s $PWD/cloudatcost-ansible-module/cac_inv.py /path/to/your/inventory/directory
This module depends on the python-cloudatcost module.
To use these modules, you must create an API key at the Cloudatcost Panel as described in the in the API documentation
You can use the api_key and api_user attributes of the server configuration, or use the CAC_API_KEY and CAC_API_USER environment variables, as so:
export CAC_API_KEY=apikeygeneratedbypanel
export [email protected]
- local_action:
module: cac_server
api_user: [email protected]
api_key: 'longStringFromCACApi'
label: cloudatcost-test1
cpus: 1
ram: 1024
storage: 10
template_id: 26
runmode: safe
wait: yes
wait_timeout: 3600
state: present
- local_action:
module: cac_server
api_user: [email protected]
api_key: 'longStringFromCaCAPI'
label: cloudatcost-test1
cpus: 1
ram: 1024
storage: 10
template_id: 26
runmode: safe
wait: yes
wait_timeout: 3600
state: present
- local_action:
module: cac_server
api_user: [email protected]
api_key: 'longStringFromCaCAPI'
sid: 12345678
label: cloudatcost-test1
state: absent
- local_action:
module: cac_server
api_user: [email protected]
api_key: 'longStringFromCaCAPI'
label: cloudatcost-test1
state: stopped
- local_action:
module: cac_server
api_user: [email protected]
api_key: 'longStringFromCaCAPI'
label: cloudatcost-test1
state: restarted