community.general.hwc_vpc_private_ip (8.5.0) — module

Creates a resource of Vpc/PrivateIP 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 private ip management.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# create a private ip
- name: Create vpc
  hwc_network_vpc:
    cidr: "192.168.100.0/24"
    name: "ansible_network_vpc_test"
  register: vpc
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create subnet
  hwc_vpc_subnet:
    gateway_ip: "192.168.100.32"
    name: "ansible_network_subnet_test"
    dhcp_enable: true
    vpc_id: "{{ vpc.id }}"
    cidr: "192.168.100.0/26"
  register: subnet
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create a private ip
  community.general.hwc_vpc_private_ip:
    subnet_id: "{{ subnet.id }}"
    ip_address: "192.168.100.33"

Inputs

    
id:
    description:
    - The ID of resource to be managed.
    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

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

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

subnet_id:
    description:
    - Specifies the ID of the subnet from which IP addresses are assigned. Cannot be changed
      after creating the private ip.
    required: true
    type: str

ip_address:
    description:
    - Specifies the target IP address. The value can be an available IP address in the
      subnet. If it is not specified, the system automatically assigns an IP address.
      Cannot be changed after creating the private ip.
    required: false
    type: str

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

Outputs

ip_address:
  description:
  - Specifies the target IP address. The value can be an available IP address in the
    subnet. If it is not specified, the system automatically assigns an IP address.
  returned: success
  type: str
subnet_id:
  description:
  - Specifies the ID of the subnet from which IP addresses are assigned.
  returned: success
  type: str