�
�Udac @` s� d d l m Z m Z m Z e Z i d d 6d g d 6d d 6Z d Z d Z d
Z d d l
m Z d d l m
Z
d d
l m Z m Z m Z d d l m Z d d l m Z m Z m Z m Z d � Z e d k r� e � n d S( i ( t absolute_importt divisiont print_functions 1.1t metadata_versiont previewt statust communityt supported_bys�
---
module: ftd_configuration
short_description: Manages configuration on Cisco FTD devices over REST API
description:
- Manages configuration on Cisco FTD devices including creating, updating, removing configuration objects,
scheduling and staring jobs, deploying pending changes, etc. All operations are performed over REST API.
version_added: "2.7"
author: "Cisco Systems, Inc. (@annikulin)"
options:
operation:
description:
- The name of the operation to execute. Commonly, the operation starts with 'add', 'edit', 'get', 'upsert'
or 'delete' verbs, but can have an arbitrary name too.
required: true
type: str
data:
description:
- Key-value pairs that should be sent as body parameters in a REST API call
type: dict
query_params:
description:
- Key-value pairs that should be sent as query parameters in a REST API call.
type: dict
path_params:
description:
- Key-value pairs that should be sent as path parameters in a REST API call.
type: dict
register_as:
description:
- Specifies Ansible fact name that is used to register received response from the FTD device.
type: str
filters:
description:
- Key-value dict that represents equality filters. Every key is a property name and value is its desired value.
If multiple filters are present, they are combined with logical operator AND.
type: dict
s�
- name: Create a network object
ftd_configuration:
operation: "addNetworkObject"
data:
name: "Ansible-network-host"
description: "From Ansible with love"
subType: "HOST"
value: "192.168.2.0"
dnsResolution: "IPV4_AND_IPV6"
type: "networkobject"
isSystemDefined: false
register_as: "hostNetwork"
- name: Delete the network object
ftd_configuration:
operation: "deleteNetworkObject"
path_params:
objId: "{{ hostNetwork['id'] }}"
se
response:
description: HTTP response returned from the API call.
returned: success
type: dict
( t
AnsibleModule( t
Connection( t BaseConfigurationResourcet CheckModeExceptiont FtdInvalidOperationNameError( t ValidationError( t construct_ansible_factst FtdConfigurationErrort FtdServerErrort FtdUnexpectedResponsec C` s� t d t d d d t � d t d d � d t d d � d t d d � d t d d � d
t d d � � } t d | d t � } | j } t | j � } t | | j � } | d } yA | j | | � } | j d
| j
d | d t | | j � � Wn t k
r} | j
d d | j � n� t k
rN} | j
d d | | j f � n� t k
r�} | j
d d | | j | j f � ns t k
r�} | j
d | j d � nJ t k
r�} | j
d | j d � n! t k
r�| j d
t � n Xd S( Nt operationt typet strt requiredt datat dictt query_paramst path_paramst register_ast filterst
argument_spect supports_check_modet changedt responset
ansible_factst msgs# Invalid operation name provided: %ssE Failed to execute %s operation because of the configuration error: %ss] Server returned an error trying to execute %s operation. Status code: %s. Server response: %si ( R t TrueR t paramsR t _socket_pathR
t
check_modet execute_operationt exit_jsont config_changedR R t fail_jsont operation_nameR R! R t codeR R t argsR
R t False( t fieldst moduleR# t
connectiont resourcet op_namet respt e( ( sQ /usr/lib/python2.7/site-packages/ansible/modules/network/ftd/ftd_configuration.pyt mainh s<