route_vpn - Create a route based VPN¶
New in version 2.5.
Synopsis¶
- Create a route based VPN. Route VPN’s are typically created between a managed Stonesoft FW and a 3rd party device (AWS, Azure, etc). You must pre-create the internal FW prior to running this module. If doing an IPSEC wrapped VPN, you must also specify a tunnel interface for which to bind (must be pre-created) and specify an IP address/interface id to specify the ISAKMP listener.
Requirements (on host that executes module)¶
- smc-python
Options¶
| parameter | required | default | choices | comments | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| enabled |
no |
|
Whether the VPN is enabled or disabled |
|||||||||||||||||||||||||||||||
| local_gw |
no |
Represents the locally managed Stonesoft FW gateway. If the remote_gw is also a Stonesoft managed device, use the same parameters to define
| ||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||
| name |
yes |
The name for this route VPN. |
||||||||||||||||||||||||||||||||
| remote_gw |
no |
The name of the remote GW. If the remote gateway is an Stonesoft FW, it must pre-exist. Use the local_gw documentation for settings. If it is an External Gateway, this module will create the gateway based on the gateway settings provided if it doesn't already exist. This documents an External Gateway configuration. See also the external_gateway module for additional external endpoint settings.
| ||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||
| 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 |
|
Specify a create or delete operation |
||||||||||||||||||||||||||||||
| tags |
no |
Provide an optional category tag to the engine. If the category does not exist, it will be created |
||||||||||||||||||||||||||||||||
| type |
no | ipsec |
|
The type of IPSEC vpn to create |
||||||||||||||||||||||||||||||
Examples¶
- name: Route VPN between internal engine and 3rd party external gateway
register: result
route_vpn:
smc_logging:
level: 10
path: ansible-smc.log
enabled: true
local_gw:
address: 50.50.50.1
name: newcluster
tunnel_interface: '1001'
name: myrbvpn
remote_gw:
external_endpoint:
- address: 33.33.33.41
enabled: true
name: extgw3 (33.33.33.41)
- address: 34.34.34.34
enabled: true
name: endpoint2 (34.34.34.34)
- address: 44.44.44.44
enabled: false
name: extgw4 (44.44.44.44)
- address: 33.33.33.50
enabled: false
name: endpoint1 (33.33.33.50)
name: extgw3
preshared_key: '********'
type: external_gateway
vpn_site:
name: extgw3-site
network:
- network-172.18.15.0/24
- network-172.18.1.0/24
- network-172.18.2.0/24
- name: Create a new Route VPN with internal gateways
route_vpn:
smc_logging:
level: 10
path: ansible-smc.log
name: myrbvpn
type: ipsec
local_gw:
name: newcluster
tunnel_interface: 1001
interface_id: 1
#address: 2.2.2.2
remote_gw:
name: myfw
tunnel_interface: 1000
interface_id: 0
tags:
- footag
Return Values¶
Common return values are documented Return Values, the following are the fields unique to this module:
| name | description | returned | type | sample |
|---|---|---|---|---|
| state |
The current state of the element
|
dict | ||
| changed |
Whether or not the change succeeded
|
always | bool |
Notes¶
Note
- Login credential information is either obtained by providing them directly to the task/play, specifying an alt_filepath to read the credentials from to the play, or from environment variables (in that order). See http://smc-python.readthedocs.io/en/latest/pages/session.html for more information.