How does Ansible panos_security_rule module work with device_group parameter?

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

How does Ansible panos_security_rule module work with device_group parameter?

L0 Member

I am trying to gather all the security rules for the specific device_group.

Here is my playbook/YAML file:

 

- name: Get all security rules fromt the Panorama
paloaltonetworks.panos.panos_security_rule:
provider:
ip_address: "{{ panorama_host }}"
api_key: "{{ netops_api_key }}"
device_group: "shared"
gathered_filter: "*"
state: gathered
register: panorama_sec_rules

- name: Write the output to json file
copy:
content: "{{ panorama_sec_rules.gathered }}"
dest: "/tmp/panorama_sec_rules.json"

 

 

When I have the device_group with the default value: "shared" or not specific, the playbook works fine.

But if I changed the device_group to any specific name which I am seeing on the GUI, it returns [] / null to my local JSON file.

 

 

I am pretty sure that I have typed the proper sensitive value for the device_group, otherwise I will see some ERROR similar to

{"msg": "Device group \"united states\" is not present."}.

 

 

Any suggestions are appreciated.

Thank you!

0 REPLIES 0
  • 43 Views
  • 0 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!