- Access exclusive content
- Connect with peers
- Share your expertise
- Find support resources
03-27-2026 10:26 AM
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.
03-29-2026 08:09 PM
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.
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!

