- Python 3.9+
- Requests 2.28.1
- Ansible 7.1.0
- Ansible Core 2.14.1 included in ansible package
First you will need to install a compatible version of python as defined above. Then you can install the depency with pip
.
pip install ansible
pip install requests
You can use ansible-galaxy
to install the SiteHost Ansible Collection:
ansible-galaxy collection install sitehost.cloud
Once the Collection is installed, you can reference it by its Fully Qualified Collection Namespace (FQCN): sitehost.cloud.module_name
.
In order to use this collection, the SH_API_KEY
and SH_CLIENT_ID
environment variable must be set to your SiteHost api key and client id respectively. Alternatively, you can pass your api key and client id to the api_key
and api_client_id
option of the modules you are calling.
Please ensure that the appropriate module permission is granted to the API key to use the relevant Ansible module.
- name: create a 1 core VPS with ubuntu jammy image
sitehost.cloud.server:
label: myserver
location: AKLCITY
product_code: XENLIT
image: ubuntu-jammy-pvh.amd64
api_client_id: "{{ CLIENT_ID }}"
api_key: "{{ USER_API_KEY }}"
state: present
Name | description |
---|---|
sitehost.cloud.server | Manages SiteHost virtual server |
sitehost.cloud.dns | Manages SiteHost DNS records and zones |
sitehost.cloud.stack | Manages SiteHost Cloud Containers |