sophos.sophos_firewall.sfos_dns module – Manage DNS settings (Configure > Network > DNS)

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

New in sophos.sophos_firewall 1.0.0

Synopsis

  • Manage DNS servers (Configure > Network > DNS) 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

dnsquery_config

string

Enable/Disable the login disclaimer

Choices:

  • "ChooseServerBasedOnIncomingRequestsRecordType"

  • "ChooseIPv6DNSServerOverIPv4"

  • "ChooseIPv4DNSServerOverIPv6"

  • "ChooseIPv6IfRequestOriginatorAddressIsIPv6"

  • "ElseIPv4"

ipv4_settings

dictionary

IPv4 DNS Settings

dns1

string

First IPv4 DNS server

dns2

string

Second IPv4 DNS server

dns3

string

Third IPv4 DNS server

dns_source

string

DNS source (DHCP/PPPoE/Static)

Choices:

  • "DHCP"

  • "PPPoE"

  • "Static"

ipv6_settings

dictionary

IPv4 DNS Settings

dns1

string

First IPv4 DNS server

dns2

string

Second IPv4 DNS server

dns3

string

Third IPv4 DNS server

dns_source

string

DNS source (DHCP/PPPoE/Static)

Choices:

  • "DHCP"

  • "PPPoE"

  • "Static"

state

string / required

Use query to retrieve or updated to modify

Choices:

  • "updated"

  • "query"

Examples

- name: Update DNS servers
  sophos.sophos_firewall.sfos_dns:
    ipv4_settings:
      dns_source: Static
      dns1: 4.2.2.1
      dns2: 4.2.2.2
      dns3: 1.1.1.1
    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)