updating a portion of the rule - ansible

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Please sign in to see details of an important advisory in our Customer Advisories area.

updating a portion of the rule - ansible

L0 Member

Wondering if anyone has had any experience updating rules. I have approximately 700 or so rules that i need to add a security profile group to... 

testing the following seems to basically overwrite anything not provided to 'any' 

 

- name: update rules to FW
panos_security_rule:
ip_address: '{{ item.firewall }}'
username: '{{ username }}'
password: '{{ password }}'
rule_name: '{{ item.rule_name }}'
group_profile: '{{ item.profile_group_name }}'
commit: 'False'
with_items: "{{ firewall_rules }}"

 

1 accepted solution

Accepted Solutions

L5 Sessionator

Yes!  You can use facts and jinja2 templating functions to accomplish this.  I've authored a blog post that explains everything step by step:

 

https://live.paloaltonetworks.com/t5/Automation-API-Blog/Ansible-Using-Facts-Modules-to-do-Updates/b...

View solution in original post

2 REPLIES 2

L5 Sessionator

Yes!  You can use facts and jinja2 templating functions to accomplish this.  I've authored a blog post that explains everything step by step:

 

https://live.paloaltonetworks.com/t5/Automation-API-Blog/Ansible-Using-Facts-Modules-to-do-Updates/b...

giggidy .. thanks!

 

  • 1 accepted solution
  • 3480 Views
  • 2 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!