updating a portion of the rule - ansible

cancel
Showing results for 
Search instead for 
Did you mean: 

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

L4 Transporter

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

L4 Transporter

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

giggidy .. thanks!

 

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!