- Access exclusive content
- Connect with peers
- Share your expertise
- Find support resources
03-17-2023 12:34 PM
I am trying to figure out a way that I can use Ansible playbook to override the interzone-default rule to add 'logging at session end'.
Have tried using panos_type_cmd but so far not having any luck. Just gettin the following error:
"module_stdout": "",
"msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
"rc": 1
Here is what the task looks like in playbook:
03-20-2023 03:40 AM
Those predefined inter and intra zone rules are slightly different, here's a task definition that works on my lab VM-Series, which I found using the GUI debug:
- name: Set logging on interzone-default
paloaltonetworks.panos.panos_type_cmd:
provider: '{{ device }}'
xpath: |
/config/devices/entry[@name='localhost.localdomain']/vsys/entry[@name='vsys1']
/rulebase/default-security-rules/rules/entry[@name='interzone-default']
cmd: edit
element:
<entry name="interzone-default"><action>deny</action><log-end>yes</log-end></entry>
Hope that helps!
03-20-2023 08:29 AM
Thanks Jimmy!
I tried the task you provided but am getting an error:
"changed": true,
"msg": "non-zero return code",
"rc": 127,
"stderr": "/bin/sh: show: command not found\n",
"stderr_lines": [
"/bin/sh: show: command not found"
],
"stdout": "",
"stdout_lines": []
03-20-2023 08:35 AM
Researching that error message, I think something else is not quite right with your Ansible environment. Are the paths set correctly? Have you got the correct Python interpreter? And got the dependencies installed in the right place?
03-20-2023 09:03 AM
Nevermind, it was just me being dumb. I had two different playbooks I was testing and was running the wrong one. It works, Thanks!
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!