.. _vyos.rest.vyos_firewall_global_module: ****************************** vyos.rest.vyos_firewall_global ****************************** **Manage global firewall configuration on VyOS devices using REST API** Version added: 1.0.0 .. contents:: :local: :depth: 1 Synopsis -------- - Manages global firewall group configuration on VyOS devices via the REST API. - Covers address-groups, network-groups, port-groups, interface-groups, and IPv6 network-groups. - Uses REST API (``connection=httpapi``) instead of CLI. Parameters ---------- .. raw:: html
Parameter Choices/Defaults Comments
config
dictionary
Global firewall configuration.
group
dictionary
Firewall groups.
address_group
list / elements=dictionary
IPv4 address groups.
address
list / elements=string
IP addresses or ranges in the group.
description
string
Group description.
name
string / required
Group name.
interface_group
list / elements=dictionary
Interface groups.
description
string
Group description.
interface
list / elements=string
Interfaces in the group.
name
string / required
Group name.
ipv6_network_group
list / elements=dictionary
IPv6 network groups.
description
string
Group description.
name
string / required
Group name.
network
list / elements=string
IPv6 network prefixes in the group.
network_group
list / elements=dictionary
IPv4 network groups.
description
string
Group description.
name
string / required
Group name.
network
list / elements=string
Network prefixes in the group.
port_group
list / elements=dictionary
Port groups.
description
string
Group description.
name
string / required
Group name.
port
list / elements=string
Ports or port ranges in the group.
state
string
    Choices:
  • merged ←
  • replaced
  • deleted
  • gathered
Desired state of the firewall global configuration.
merged adds or updates without removing existing config.
replaced replaces the entire firewall global configuration.
deleted removes firewall global configuration.
gathered returns current configuration as structured data.

Notes ----- .. note:: - Requires ``ansible_connection=httpapi`` with the VyOS httpapi plugin. - ``ansible_network_os`` must be set to ``vyos.rest.vyos``. Examples -------- .. code-block:: yaml - name: Merge firewall global configuration vyos.rest.vyos_firewall_global: config: group: address_group: - name: SERVERS description: Web servers address: - 192.168.1.10 - 192.168.1.11 network_group: - name: LAN network: - 192.168.0.0/16 port_group: - name: WEB-PORTS port: - "80" - "443" interface_group: - name: LAN-IFACES interface: - eth1 - eth2 ipv6_network_group: - name: IPV6-LAN network: - "2001:db8::/32" state: merged - name: Delete all firewall global configuration vyos.rest.vyos_firewall_global: state: deleted - name: Gather firewall global configuration vyos.rest.vyos_firewall_global: state: gathered Return Values ------------- Common return values are documented `here `_, the following are the fields unique to this module: .. raw:: html
Key Returned Description
after
dictionary
when changed
Firewall global configuration after this module ran.

before
dictionary
always
Firewall global configuration before this module ran.

commands
list
always
List of API command tuples sent to the device.

gathered
dictionary
when state is gathered
Current firewall global configuration as structured data.

response
dictionary
always
Raw API response.

saved
boolean
when changed
Whether the config was saved after changes.



Status ------ Authors ~~~~~~~ - VyOS Community (@vyos)