community.proxmox.proxmox_subnet module – Create/Update/Delete subnets from SDN
Note
This module is part of the community.proxmox collection (version 1.4.0).
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.proxmox.
You need further requirements to be able to use this module,
see Requirements for details.
To use it in a playbook, specify: community.proxmox.proxmox_subnet.
New in community.proxmox 1.4.0
Synopsis
Create, update, or delete subnets in Proxmox SDN.
Requirements
The below requirements are needed on the host that executes this module.
proxmoxer >= 2.0
requests
Parameters
Parameter |
Comments |
|---|---|
Specify the target host of the Proxmox VE cluster. Uses the |
|
Specify the password to authenticate with. Uses the |
|
Specify the target port of the Proxmox VE cluster. Uses the |
|
Specify the token ID. Uses the |
|
Specify the token secret. Uses the |
|
Specify the user to authenticate with. Uses the |
|
A list of settings you want to delete. |
|
IP address for the DNS server. |
|
Range of IP addresses for DHCP. |
|
Ending IP address of the DHCP range. |
|
Starting IP address of the DHCP range. |
|
Only applicable for If set to append and new dhcp_range passed it will just append to existing ranges. And If no dhcp_range passed and there are existing ranges it will just ignore existing ranges and only update other params if needed If set to overwrite and new dhcp_range passed it will overwrite existing ranges. If no dhcp_range passed and there are existing ranges it will delete all dhcp_ranges Choices:
|
|
Prefix for the DNS zone. |
|
Subnet Gateway. Will be assign on vnet for layer3 zones. |
|
the token for unlocking the global SDN configuration. |
|
Enable Source NAT for the subnet. Choices:
|
|
Desired state of the subnet configuration. Choices:
|
|
Subnet CIDR. |
|
If This should only be used on personally controlled sites using self-signed certificates. Uses the Choices:
|
|
The virtual network to which the subnet belongs. |
|
Vnet Zone. |
Attributes
Attribute |
Support |
Description |
|---|---|---|
Action group: community.proxmox.proxmox |
Use |
|
Support: none |
Can run in |
|
Support: none |
Will return details on what has changed (or possibly needs changing in |
Examples
- name: Create a subnet
community.proxmox.proxmox_subnet:
api_user: "{{ pc.proxmox.api_user }}"
api_token_id: "{{ pc.proxmox.api_token_id }}"
api_token_secret: "{{ vault.proxmox.api_token_secret }}"
api_host: "{{ pc.proxmox.api_host }}"
validate_certs: false
vnet: test
subnet: 10.10.2.0/24
zone: ans1
state: present
dhcp_range:
- start: 10.10.2.5
end: 10.10.2.50
- start: 10.10.2.100
end: 10.10.2.150
snat: true
- name: Delete a subnet
community.proxmox.proxmox_subnet:
api_user: "{{ pc.proxmox.api_user }}"
api_token_id: "{{ pc.proxmox.api_token_id }}"
api_token_secret: "{{ vault.proxmox.api_token_secret }}"
api_host: "{{ pc.proxmox.api_host }}"
validate_certs: false
vnet: test
subnet: 10.10.2.0/24
zone: ans1
state: absent
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
|---|---|
Subnet ID which was created/updated/deleted Returned: on success Sample: |