sophos.sophos_firewall.sfos_urlgroup module – Manage URL Groups on Sophos Firewall

Note

This module is part of the sophos.sophos_firewall collection (version 2.2.0).

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 sophos.sophos_firewall. You need further requirements to be able to use this module, see Requirements for details.

To use it in a playbook, specify: sophos.sophos_firewall.sfos_urlgroup.

New in sophos.sophos_firewall 2.2.0

Synopsis

  • Creates, updates or removes URL Groups from Sophos Firewall

Requirements

The below requirements are needed on the host that executes this module.

  • sophosfirewall-python

  • Beginning in version 2.0.0, this module requires use of an httpapi connection plugin. See the HTTPAPI example for details.

Parameters

Parameter

Comments

action

string

Action to perform when updating a URL Group.

Required when state=update.

Choices:

  • "add"

  • "remove"

  • "replace"

domain_list

list / elements=string

List of domains to be included in the URL Group.

name

string / required

Name of the URL Group to create, update, or delete

state

string / required

Use present to create, absent to remove, update to modify, or query to get information

Choices:

  • "present"

  • "absent"

  • "update"

  • "query"

Examples

- name: Get all URL groups
  sophos.sophos_firewall.sfos_urlgroup:
    state: query

- name: Get specific URL group
  sophos.sophos_firewall.sfos_urlgroup:
    state: query
    name: "Marketing_Websites"

- name: Create a URL group
  sophos.sophos_firewall.sfos_urlgroup:
    state: present
    name: "Marketing_Websites"
    domain_list:
      - example.com
      - example.org

- name: Add domains to existing URL group
  sophos.sophos_firewall.sfos_urlgroup:
    state: update
    name: "Marketing_Websites"
    domain_list:
      - example.net
      - example.io
    action: add

- name: Remove domains from URL group
  sophos.sophos_firewall.sfos_urlgroup:
    state: update
    name: "Marketing_Websites"
    domain_list:
      - example.net
    action: remove

- name: Replace all domains in URL group
  sophos.sophos_firewall.sfos_urlgroup:
    state: update
    name: "Marketing_Websites"
    domain_list:
      - new-example.com
      - new-example.org
    action: replace

- name: Delete URL group
  sophos.sophos_firewall.sfos_urlgroup:
    state: absent
    name: "Marketing_Websites"

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key

Description

api_response

dictionary

Serialized object containing the API response.

Returned: always

Authors

  • Sophos