community.general.hwc_network_vpc – Creates a Huawei Cloud VPC

Note

This plugin is part of the community.general collection (version 3.8.1).

You might already have this collection installed if you are using the ansible package. It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install community.general.

To use it in a playbook, specify: community.general.hwc_network_vpc.

Synopsis

  • Represents an vpc resource.

Requirements

The below requirements are needed on the host that executes this module.

  • requests >= 2.18.4
  • keystoneauth1 >= 3.6.0

Parameters

Parameter Choices/Defaults Comments
cidr
string / required
The range of available subnets in the vpc.
domain
string / required
The name of the Domain to scope to (Identity v3). (currently only domain names are supported, and not domain IDs).
id
string
The id of resource to be managed.
identity_endpoint
string / required
The Identity authentication URL.
name
string / required
The name of vpc.
password
string / required
The password to login with.
project
string / required
The name of the Tenant (Identity v2) or Project (Identity v3). (currently only project names are supported, and not project IDs).
region
string
The region to which the project belongs.
state
string
    Choices:
  • present
  • absent
Whether the given object should exist in vpc.
timeouts
dictionary
The timeouts for each operations.
create
string
Default:
"15m"
The timeout for create operation.
delete
string
Default:
"15m"
The timeout for delete operation.
update
string
Default:
"15m"
The timeout for update operation.
user
string / required
The user name to login with (currently only user names are supported, and not user IDs).

Notes

Note

  • For authentication, you can set identity_endpoint using the ANSIBLE_HWC_IDENTITY_ENDPOINT env variable.
  • For authentication, you can set user using the ANSIBLE_HWC_USER env variable.
  • For authentication, you can set password using the ANSIBLE_HWC_PASSWORD env variable.
  • For authentication, you can set domain using the ANSIBLE_HWC_DOMAIN env variable.
  • For authentication, you can set project using the ANSIBLE_HWC_PROJECT env variable.
  • For authentication, you can set region using the ANSIBLE_HWC_REGION env variable.
  • Environment variables values will only be used if the playbook values are not set.

Examples

- name: Create a vpc
  community.general.hwc_network_vpc:
      identity_endpoint: "{{ identity_endpoint }}"
      user: "{{ user }}"
      password: "{{ password }}"
      domain: "{{ domain }}"
      project: "{{ project }}"
      region: "{{ region }}"
      name: "vpc_1"
      cidr: "192.168.100.0/24"
      state: present

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key Returned Description
cidr
string
success
the range of available subnets in the vpc.

enable_shared_snat
boolean
success
show whether the shared snat is enabled.

id
string
success
the id of vpc.

name
string
success
the name of vpc.

routes
complex
success
the route information.

destination
string
success
the destination network segment of a route.

next_hop
string
success
the next hop of a route. If the route type is peering, it will provide VPC peering connection ID.

status
string
success
the status of vpc.



Authors

  • Huawei Inc. (@huaweicloud)

© 2012–2018 Michael DeHaan
© 2018–2021 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/latest/collections/community/general/hwc_network_vpc_module.html