sophos.sophos_firewall.sfos_fqdn_hostgroup module – Manage FQDN Host Groups (System > Hosts & services > FQDN host 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_fqdn_hostgroup.

New in sophos.sophos_firewall 1.0.0

Synopsis

  • Creates, updates or removes an FQDN Host Group (System > Hosts & services > FQDN host 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

action

string

Indicates whether to add or remove hosts from the list, or replace the list entirely.

Choices:

  • "add"

  • "remove"

  • "replace"

description

string

Description to be included on the FQDN Host Group object.

host_list

list / elements=string

List of FQDN Host objects to be included in the FQDN Hostgroup

name

string / required

Name of the FQDN Host Group object to create, update, or delete

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 FQDN Host Group
  sophos.sophos_firewall.sfos_fqdn_hostgroup:
    username: "{{ username }}"
    password: "{{ password }}"
    hostname: myfirewallhostname.sophos.net
    port: 4444
    verify: false
    name: TESTHOSTGROUP
    state: query
  delegate_to: localhost

- name: Create FQDN Host Group
  sophos.sophos_firewall.sfos_fqdn_hostgroup:
    name: TESTFQDNHOSTGROUP
    description: Test FQDN Host Group
    fqdn_host_list:
      - TESTHOST1
      - TESTHOST2
    state: present

- name: Add Hosts to FQDN Host Group
  sophos.sophos_firewall.sfos_fqdn_hostgroup:
    name: TESTHOSTGROUP
    description: Test Host Group
    fqdn_host_list:
      - TESTHOST3
      - TESTHOST4
    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)