This collection includes a series of Ansible modules for interacting with Huaweicloud.
The usage of this collection assumes that you've already setup an Ansible environment for HuaweiCloud.
Installed the ansible in your environment.
Install dependencies.
pip install -r requirements.txt
Install the collection.
$ ansible-galaxy collection install hwceco.hwcollection
Upgrade to the lastet version of the collection.
$ ansible-galaxy collection install hwceco.hwcollection --force
$ cat test.yml
- hosts: localhost
collections:
- hwceco.hwcollection
tasks:
- name: create a new vpc
hwc_vpc:
access_key: "{{ access_key }}"
secret_key: "{{ secret_key }}"
project_id: "{{ project_id }}"
region: "{{ region }}"
name: "{{ vpc_name }}"
cidr: "192.168.100.0/24"
state: present
register: vpc
- name: dump the output
debug:
msg: '{{ vpc }}'
$ ansible-playbook test.yml
Apache 2.0