sophos.sophos_firewall.sfos_ip_host module – Manage IP Host (System > Hosts & services > IP host)

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

New in sophos.sophos_firewall 1.0.0

Synopsis

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

end_ip

string

Ending IP address for use when creating an IP range.

host_type

string

Type of IP Host object.

Choices:

  • "ip" ← (default)

  • "network"

  • "range"

ip_address

string

IP Address for use when creating an IP address.

mask

string

Network mask for use when creating an IP network.

name

string / required

Name of the IP Host object to create, update, or delete

network

string

Network address for use when creating an IP network.

start_ip

string

Starting IP address for use when an creating IP range.

state

string / required

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

Choices:

  • "present"

  • "absent"

  • "updated"

  • "query"

Examples

- name: Create IP Host
  sophos.sophos_firewall.sfos_ip_host:
    name: TESTHOST
    ip_address: 1.1.1.1
    state: present

- name: Create IP Network
  sophos.sophos_firewall.sfos_ip_host:
    name: TESTNETWORK
    network: 1.1.1.0
    mask: 255.255.255.0
    host_type: network
    state: present

- name: Create IP Range
  sophos.sophos_firewall.sfos_ip_host:
    name: TESTRANGE
    start_ip: 10.1.1.1
    end_ip: 10.1.1.2
    host_type: range
    state: present

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)