community.general.hwc_vpc_route (8.5.0) — module

Creates a resource of Vpc/Route in Huawei Cloud

| "added in version" 0.2.0 of community.general"

Authors: Huawei Inc. (@huaweicloud)

Install collection

Install with ansible-galaxy collection install community.general:==8.5.0


Add to requirements.yml

  collections:
    - name: community.general
      version: 8.5.0

Description

vpc route management.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# create a peering connect
- name: Create a local vpc
  hwc_network_vpc:
    cidr: "192.168.0.0/16"
    name: "ansible_network_vpc_test_local"
  register: vpc1
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create a peering vpc
  hwc_network_vpc:
    cidr: "192.168.0.0/16"
    name: "ansible_network_vpc_test_peering"
  register: vpc2
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create a peering connect
  hwc_vpc_peering_connect:
    local_vpc_id: "{{ vpc1.id }}"
    name: "ansible_network_peering_test"
    filters:
      - "name"
    peering_vpc:
      vpc_id: "{{ vpc2.id }}"
  register: connect
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create a route
  community.general.hwc_vpc_route:
    vpc_id: "{{ vpc1.id }}"
    destination: "192.168.0.0/16"
    next_hop: "{{ connect.id }}"

Inputs

    
id:
    description:
    - The ID of resource to be managed.
    type: str

type:
    default: peering
    description:
    - Specifies the type of route.
    required: false
    type: str

user:
    description:
    - The user name to login with.
    - Currently only user names are supported, and not user IDs.
    required: true
    type: str

state:
    choices:
    - present
    - absent
    default: present
    description:
    - Whether the given object should exist in Huawei Cloud.
    type: str

domain:
    description:
    - The name of the Domain to scope to (Identity v3).
    - Currently only domain names are supported, and not domain IDs.
    required: true
    type: str

region:
    description:
    - The region to which the project belongs.
    type: str

vpc_id:
    description:
    - Specifies the VPC ID to which route is added.
    required: true
    type: str

project:
    description:
    - The name of the Tenant (Identity v2) or Project (Identity v3).
    - Currently only project names are supported, and not project IDs.
    required: true
    type: str

next_hop:
    description:
    - Specifies the next hop. The value is VPC peering connection ID.
    required: true
    type: str

password:
    description:
    - The password to login with.
    required: true
    type: str

destination:
    description:
    - Specifies the destination IP address or CIDR block.
    required: true
    type: str

identity_endpoint:
    description:
    - The Identity authentication URL.
    required: true
    type: str

Outputs

destination:
  description:
  - Specifies the destination IP address or CIDR block.
  returned: success
  type: str
id:
  description:
  - UUID of the route.
  returned: success
  type: str
next_hop:
  description:
  - Specifies the next hop. The value is VPC peering connection ID.
  returned: success
  type: str
type:
  description:
  - Specifies the type of route.
  returned: success
  type: str
vpc_id:
  description:
  - Specifies the VPC ID to which route is added.
  returned: success
  type: str