目录

Ansible Collection for Huaweicloud

This collection includes a series of Ansible modules for interacting with Huaweicloud.

Prerequisite

The usage of this collection assumes that you’ve already setup an Ansible environment for HuaweiCloud.

Installed the ansible in your environment.

Installation

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

Example Playbook

$ 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 }}'

Run ansible

$ ansible-playbook test.yml

License

Apache 2.0

关于
254.0 KB
邀请码
    Gitlink(确实开源)
  • 加入我们
  • 官网邮箱:gitlink@ccf.org.cn
  • QQ群
  • QQ群
  • 公众号
  • 公众号

版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9 京公网安备 11010802047560号