diff --git a/lib/ansible/modules/network/panos/panos_import.py b/lib/ansible/modules/network/panos/panos_import.py index 64496463ff..e7dff9d18b 100644 --- a/lib/ansible/modules/network/panos/panos_import.py +++ b/lib/ansible/modules/network/panos/panos_import.py @@ -25,6 +25,9 @@ module: panos_import short_description: import file on PAN-OS devices description: - Import file on PAN-OS device +notes: + - API reference documentation can be read from the C(/api/) directory of your appliance + - Certificate validation is enabled by default as of Ansible 2.6. This may break existing playbooks but should be disabled with caution. author: "Luigi Mori (@jtschichold), Ivan Bojer (@ivanbojer)" version_added: "2.3" requirements: @@ -47,6 +50,7 @@ options: category: description: - Category of file uploaded. The default is software. + - See API > Import section of the API reference for category options. default: software file: description: @@ -54,6 +58,12 @@ options: url: description: - URL of the file that will be imported to device. + validate_certs: + description: + - If C(no), SSL certificates will not be validated. Disabling certificate validation is not recommended. + default: yes + type: bool + version_added: "2.6" ''' EXAMPLES = ''' @@ -113,7 +123,7 @@ def import_file(xapi, module, ip_address, file_, category): r = requests.post( 'https://' + ip_address + '/api/', - verify=False, + verify=module.params['validate_certs'], params=params, headers={'Content-Type': mef.content_type}, data=mef @@ -150,7 +160,8 @@ def main(): username=dict(default='admin'), category=dict(default='software'), file=dict(), - url=dict() + url=dict(), + validate_certs=dict(type='bool', default=True), ) module = AnsibleModule(argument_spec=argument_spec, supports_check_mode=False, required_one_of=[['file', 'url']]) if not HAS_LIB: