Ansible-使用Ansible在华为云上创建一台ECS实例:创建子网(subnet)

时间:2023-11-01 16:13:45

创建子网(subnet)

在创建E CS 实例时,您必须要指定ECS实例所属的子网。

以下Ansible playbook展示了如何创建一个子网。

- name: create a subnet  hwc_vpc_subnet:    gateway_ip: "192.168.100.32"    name: "ansible_network_subnet_test"    dhcp_enable: true    vpc_id: "{{ vpc.state.id }}"    filters:      - "name"    cidr: "192.168.100.0/26"  register: subnet
support.huaweicloud.com/qs-ansible/ansible_0002.html