PaloAltoNetworks / pan-os-ansible

Ansible collection for easy automation of Palo Alto Networks next generation firewalls and Panorama, in both physical and virtual form factors.
https://pan.dev/ansible/docs/panos
Apache License 2.0
202 stars 97 forks source link

panos_export wrong param passed to API for including keys #163

Closed bkarypid closed 3 years ago

bkarypid commented 3 years ago

Describe the bug

According to the docs, to export a certificate the pan-os API expects the "include-key" param to be passed, with an expected value of yes or no. See https://docs.paloaltonetworks.com/pan-os/9-1/pan-os-panorama-api/pan-os-xml-api-request-types/export-files-api/export-certificates-and-keys.html for more details

However, the panos_export module is instead passing a "include-keys" param to the pan-os API, which is not an expected param.

Expected behavior

Using the panos_export module, I should be able to export a certificate from a pan-os device.

Current behavior

The task fails, with this in the error message: "PanURLError: URLError: code: 400 reason: Parameter "include-key" is required while exporting certificate"

Possible solution

Rename the include-keys param to include-key

Steps to reproduce

Executing this task will fail with the error mentioned above - see screenshot below for details

- name: Obtain CSR from Panorama API
  panos_export:
    provider: "{{ provider }}"
    category: certificate
    certificate_name: test_cert
    certificate_format: pkcs10
    filename: test.crt
  register: csr_response

Screenshots

panos_export_fail

Context

Unable to export certificates via the panos_export module

Your Environment

welcome-to-palo-alto-networks[bot] commented 3 years ago

:tada: Thanks for opening your first issue here! Welcome to the community!

github-actions[bot] commented 3 years ago

:tada: This issue has been resolved in version 2.2.2 :tada:

The release is available on Ansible Galaxy and GitHub release

Posted by semantic-release bot