No way to use target to send an op command to a firewall from Panorama using the supported Ansible modules?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

No way to use target to send an op command to a firewall from Panorama using the supported Ansible modules?

L1 Bithead

I can do this by calling the API manually, but I can't seem to use the operation command module. 

curl --location --globoff 'https://<Panorama-IP>/api/?type=op&cmd=<show><system><info></info></system></show>&target=0123456789&key=<your-api-key>'

Skrting the issue in Ansible:

- name: Run an op command on a firewall from Panorama
  ansible.builtin.uri:
    url: "https://{{ ip_address }}/api/?type=op&target={{ active_fw_serial }}&cmd={{ policy_match_xml | urlencode }}&key={{ panorama_api_key }}"
 


Maybe I am missing something, but a quick look at the Python doesn't look like I can use the module for this. To have to manage another set of access, credentials, etc, to reach the firewalls directly for operational commands feels a bit off. 

1 REPLY 1

L4 Transporter

Hello @Eric_B 

 

First of all, as a disclaimer, I'm not an expert in ansible.

 

I just looked the doc of the Ansible available modules.

- panos_op
https://galaxy.ansible.com/ui/repo/published/paloaltonetworks/panos/content/module/panos_op/

- panos_type_cmd

https://galaxy.ansible.com/ui/repo/published/paloaltonetworks/panos/content/module/panos_type_cmd/

 

For both modules, I see there is the "serial_number" which can be used for the target.

Have you explored that?

Olivier

 

NGFW Engineer - NetSec Analyst - NetSec Architect - CISSP

Best Effort contributor

Check out our PANCast Channel

Disclaimer : All messages are my personal ones and do not represent my company's view in any way.

  • 334 Views
  • 1 replies
  • 0 Likes
Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

Click Accept as Solution to acknowledge that the answer to your question has been provided.

The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!

These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!

The LIVEcommunity thanks you for your participation!