policy_vpn - Create, modify or delete Policy VPNs¶
New in version 2.5.
Synopsis¶
- Manage a policy VPN. This module provides the ability to fully create a VPN, along with modifying central / satellite gateways as well as tags. Only satellite gateways, central gateways and tags can be deleted. All other options provided in the constructor can be modified or added.
Requirements (on host that executes module)¶
- smc-python
Options¶
| parameter | required | default | choices | comments | |||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| apply_nat |
no |
Whether to apply NAT to this VPN. Doing so may require NAT rules be in place. |
|||||||||||||||||||||||||||
| central_gw |
no |
Central gateways to add to the policy VPN. Can be SMC managed internal hosts or external gateways.
| |||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||
| gateway_tunnel |
no |
Used when modifying a specific gateway tunnel configuration. This can be used to change a preshared key or disable a specific tunnel
| |||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||
| name |
yes |
The name of the policy VPN |
|||||||||||||||||||||||||||
| satellite_gw |
no |
Central gateways to add to the policy VPN. Can be SMC managed internal hosts or external gateways.
| |||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||
| smc_address |
no |
FQDN with port of SMC. The default value is the environment variable |
|||||||||||||||||||||||||||
| smc_alt_filepath |
no |
Provide an alternate path location to read the credentials from. File is expected to be stored in ~.smcrc. If provided, url and api_key settings are not required and will be ignored. |
|||||||||||||||||||||||||||
| smc_api_key |
no |
API key for api client. The default value is the environment variable |
|||||||||||||||||||||||||||
| smc_api_version |
no |
Optional API version to connect to. If none is provided, the latest SMC version API will be used based on the Management Center version. Can be set though the environment variable |
|||||||||||||||||||||||||||
| smc_domain |
no |
Optional domain to log in to. If no domain is provided, 'Shared Domain' is used. Can be set throuh the environment variable |
|||||||||||||||||||||||||||
| smc_extra_args |
no |
Extra arguments to pass to login constructor. These are generally only used if specifically requested by support personnel.
| |||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||
| smc_logging |
no |
Optionally enable SMC API logging to a file
| |||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||
| smc_timeout |
no |
Optional timeout for connections to the SMC. Can be set through environment |
|||||||||||||||||||||||||||
| state |
no | present |
|
Create or delete a firewall cluster |
|||||||||||||||||||||||||
| tags |
no |
Optional tags to add to this engine |
|||||||||||||||||||||||||||
| vpn_profile |
no | VPN-A Suite |
Optional VPN profile to use for this policy VPN |
||||||||||||||||||||||||||
Examples¶
- name: Add gateways to a policy VPN (VPN is created if it doesn't exist)
policy_vpn:
name: mynewvpn
central_gw:
- name: myfirewall
type: internal_gateway
satellite_gw:
- name: newextgw
type: external_gateway
tags:
- footag
# Retrieve tunnel_side_a and tunnel_side_b values by calling policy_vpn_facts
- name: Change a preshared key for existing tunnel and enable the tunnel
policy_vpn:
name: mynewvpn
gateway_tunnel:
- tunnel_side_a: anothergw
tunnel_side_b: fw33 - Primary
preshared_key: abc123
enabled: yes
- name: Delete a single satellite gateway from this VPN
policy_vpn:
name: mynewvpn
satellite_gw:
- name: newextgw
type: external_gateway
state: absent
- name: Delete tags from a policy VPN
policy_vpn:
name: mynewvpn
tags:
- footag
state: absent
- name: Delete the entire policy VPN
policy_vpn:
name: mynewvpn
state: absent
Return Values¶
Common return values are documented Return Values, the following are the fields unique to this module:
| name | description | returned | type | sample |
|---|---|---|---|---|
| state |