sophos.sophos_firewall.sfos_ipsec_connection module – Manage IPSec Connection (Configure > Site-to-site VPN > IPSec)
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_ipsec_connection
.
New in sophos.sophos_firewall 1.5.0
Synopsis
Manage IPSec Connection (Configure > Site-to-site VPN > IPSec) 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 |
---|---|
Activate the connection (only available after creation) Choices:
|
|
Enable or Disable NAT traversal Choices:
|
|
Password for user authentication in AsClient authentication mode |
|
Username for user authentication in AsClient authentication mode |
|
User for user authentication in AsServer authentication mode |
|
Authentication type based on the Connection type Choices:
|
|
Establish a connection (only available after creation) Choices:
|
|
Type of VPN connection Choices:
|
|
VPN Connection description |
|
Disconnect on idle interval in seconds |
|
Remote host |
|
Action to be taken when VPN Services restarts Choices:
|
|
IP address family of local and remote subnets Choices:
|
|
A WAN interface on the local firewall |
|
Name of local certificate to be used when |
|
Local ID |
|
Local ID type Choices:
|
|
Local port |
|
Local subnet |
|
VPN Connection name |
|
Host for NAT (Hide) mode |
|
Preshared key |
|
IPSec Profile to be used for connection Choices:
|
|
Protocol Choices:
|
|
Name of remote certificate to be used when |
|
Remote ID to be used with RemoteAccess or HostToHost connection type |
|
Remote ID type to be used with RemoteAccess or HostToHost connection type Choices:
|
|
Remote port |
|
RSA key of remote peer |
|
Remote network for RemoteAccess or HostToHost connection type |
|
Use Choices:
|
|
User authentication mode for RemoteAccess or HostToHost connection type Choices:
|
Examples
- name: Create IPSec Connection Site-to-Site
sophos.sophos_firewall.sfos_ipsec_connection:
name: Test_IPSec_Connection_S2S
description: Testing IPSec Connection from Ansible
connection_type: SiteToSite
gateway_type: RespondOnly
profile: IKEv2
authentication_type: PresharedKey
preshared_key: testkey1234567890!
listening_interface: PortB
gateway_address: 10.100.100.10
local_id_type: DNS
local_id: portB.example.vpn.sophos.com
local_subnet:
- TESTVPNSUB1
remote_subnet:
- TESTVPNSUB2
state: present
- name: Create IPSec Connection with Tunnel Interface
sophos.sophos_firewall.sfos_ipsec_connection:
name: Test_IPSec_Connection_Tunnel
description: Testing IPSec Connection from Ansible
connection_type: TunnelInterface
gateway_type: RespondOnly
profile: DefaultBranchOffice
authentication_type: RSAKey
remote_rsa_key: testkey
listening_interface: PortB
gateway_address: 10.10.10.1
local_id_type: DNS
local_id: portB.example.vpn.sophos.com
remote_id_type: IP Address
remote_id: 2.2.2.2
state: present
tags: tunnel
- name: Query IPSec Connection
sophos.sophos_firewall.sfos_ipsec_connection:
name: Test IPSec Connection
state: query
- name: Activate IPSec Connection
sophos.sophos_firewall.sfos_ipsec_connection:
enabled: true
name: Test IPSec Connection
active: true
state: updated
- name: Remove IPSec Connection
sophos.sophos_firewall.sfos_ipsec_connection:
enabled: true
name: snmpv3user
state: absent
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
Serialized object containing the API response. Returned: always |
Collection links
Warning
If the firewall is a member of a group in Central, the changes made by Ansible will override the settings of the group. The actual configuration on the firewall may then differ from what is displayed for the same setting in the Central group.