community.proxmox.proxmox_cluster_firewall_security_group module – Cluster firewall security group management for Proxmox VE
Note
This module is part of the community.proxmox collection (version 2.1.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_cluster_firewall_security_group.
New in community.proxmox 2.1.0
Synopsis
Manage cluster-level firewall security groups in Proxmox VE.
Security groups hold ordered firewall rules that can be attached to guest rules.
If
rulesis omitted whenstate=present, the module only creates the group and/or updates its comment; existing rules are not read or modified.If
rulesis set (including an empty list), the module synchronizes the full ordered ruleset, mapping list index 0 to position 0, etc.
Requirements
The below requirements are needed on the host that executes this module.
proxmoxer >= 2.3
requests
Parameters
Parameter |
Comments |
|---|---|
Specify the target host of the Proxmox VE cluster. Uses the |
|
Specify the OTP. Uses the |
|
Specify the password to authenticate with. Uses the |
|
Specify the target port of the Proxmox VE cluster. Uses the |
|
Time limit for requests towards the Proxmox VE API. Default: |
|
Specify the token ID. Uses the |
|
Specify the token secret. Uses the |
|
Specify the user to authenticate with. Uses the Default: |
|
Path to a local certificate, which will be used to verify TLS connections. Ignored if |
|
Security group comment. |
|
Security group name. |
|
Whether each If If Only used when If not set, Choices:
|
|
Full ordered list of firewall rules for the group, with index Omitted to manage only the group and comment, leaving current rules unchanged.
If Optional rule fields except
|
|
Rule action ( |
|
Rule comment. |
|
Match packet destination address. This can refer to a single IP address, an IP set (‘+ipsetname’) or an IP alias definition. You can also specify an address range like |
|
Match TCP/UDP destination port. You can use service names or simple numbers |
|
Whether the rule is active. Choices:
|
|
ICMP type (when |
|
Network interface name. |
|
Log level for matching packets. Choices:
|
|
Built-in firewall macro name. Use predefined standard macro from https://pve.proxmox.com/pve-docs/pve-admin-guide.html#_firewall_macro_definitions |
|
Match IP protocol (name or number per |
|
Match packet source address. This can refer to a single IP address, an IP set (‘+ipsetname’) or an IP alias definition. You can also specify an address range like |
|
Match TCP/UDP source port. You can use service names or simple numbers |
|
Rule direction or special type. Choices:
|
|
The desired state of the security group. Choices:
|
|
Validate the TLS certificates used for the connection to the Proxmox VE API. May be set through the environment variable Choices:
|
Attributes
Attribute |
Support |
Description |
|---|---|---|
Action group: community.proxmox.proxmox |
Use |
|
Support: full |
Can run in |
|
Support: none |
Will return details on what has changed (or possibly needs changing in |
See Also
See also
- Proxmox VE security group reference
Security group reference for Proxmox VE Firewall
- community.proxmox.proxmox_cluster_firewall_options
Cluster-level firewall options management for Proxmox VE cluster.
- community.proxmox.proxmox_node_firewall_options
Node-level firewall options management for Proxmox VE cluster.
- community.proxmox.proxmox_firewall
Manage firewall rules in Proxmox.
- Authentication
Complete guide for the Proxmox API authentication
Examples
- name: Webserver security group
community.proxmox.proxmox_cluster_firewall_security_group:
name: webserver
comment: Managed by Ansible
purge_omitted_rule_fields: true
rules:
- type: in
action: ACCEPT
comment: Allow HTTP
dest: 192.168.1.100
dport: "80"
proto: tcp
log: info
- type: in
action: ACCEPT
comment: Allow HTTPS
dest: 192.168.1.100
dport: "443"
proto: tcp
log: info
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
|---|---|
The security group comment. Returned: on success Sample: |
|
A short message on what the module did. Returned: always Sample: |
|
The security group name. Returned: on success Sample: |
|