�
�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 d d l Z d � Z d � Z e d k r� e � n d S( i ( t absolute_importt divisiont print_functions 1.1t metadata_versiont previewt statust networkt supported_bysq
---
module: checkpoint_run_script
short_description: Run scripts on Check Point devices over Web Services API
description:
- Run scripts on Check Point devices.
All operations are performed over Web Services API.
version_added: "2.8"
author: "Ansible by Red Hat (@rcarrillocruz)"
options:
script_name:
description:
- Name of the script.
type: str
required: True
script:
description:
- Script body contents.
type: str
required: True
targets:
description:
- Targets the script should be run against. Can reference either name or UID.
type: list
required: True
s�
- name: Run script
checkpoint_run_script:
script_name: "List root"
script: ls -l /
targets:
- mycheckpointgw
sj
checkpoint_run_script:
description: The checkpoint run script output.
returned: always.
type: list
( t
AnsibleModule( t
Connection( t publisht install_policyNc C` sd | j d } | j d } | j d } i | d 6| d 6| d 6} | j d | � \ } } | | f S( Nt script_namet scriptt targetss script-names /web_api/run-script( t paramst send_request( t modulet
connectionR R
R t payloadt codet response( ( s] /usr/lib/python2.7/site-packages/ansible/modules/network/check_point/checkpoint_run_script.pyt
run_scriptN s
c C` s� t d t d d d t � d t d d d t � d t d d d t � � } t d | � } t | j � } t | | � \ } } i t d 6} | d
k r� | | d <n | j d d
j | | � � | j | � d S( NR t typet strt requiredR
R t listt
argument_spect changedi� t checkpoint_run_scriptt msgs5 Checkpoint device returned error {0} with message {1}( t dictt TrueR R t _socket_pathR t fail_jsont formatt exit_json( R R R R R t result( ( s] /usr/lib/python2.7/site-packages/ansible/modules/network/check_point/checkpoint_run_script.pyt main\ s
t __main__( t
__future__R R R R t
__metaclass__t ANSIBLE_METADATAt
DOCUMENTATIONt EXAMPLESt RETURNt ansible.module_utils.basicR t ansible.module_utils.connectionR t2 ansible.module_utils.network.checkpoint.checkpointR
R t jsonR R&