sophos.sophos_firewall.sfos_servicegroup module – Manage Service Group (System > Hosts and services > Service Group)

Note

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

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_servicegroup.

New in sophos.sophos_firewall 1.0.0

Synopsis

  • Creates, updates or removes a Service Group (System > Hosts and services > Service Group) on 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

description

string

Description to be included on the Service Group object.

name

string / required

Name of the Service Group object to create, update, or delete

service_list

list / elements=string

List of Service objects to be included in the Servicegroup

state

string / required

Use query to retrieve, present to create, absent to remove, or updated to modify

Choices:

  • "present"

  • "absent"

  • "updated"

  • "query"

Examples

- name: Retrieve Service Group
  sophos.sophos_firewall.sfos_servicegroup:
    name: TESTSERVICEGROUP
    state: query

- name: Create Service Group
  sophos.sophos_firewall.sfos_servicegroup:
    name: TESTSERVICEGROUP
    description: Test Service Group
    service_list:
      - HTTP
      - HTTPS
    state: present

- name: Add Services to Service Group
  sophos.sophos_firewall.sfos_servicegroup:
    name: TESTSERVICEGROUP
    description: Test Host Group
    service_list:
      - TESTSERVICE3
      - TESTSERVICE4
    action: add
    state: updated

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

  • Matt Mullen (@mamullen13316)