Looking at the module code, it looks like the
disabled flag is not currently exposed as a param for playbooks. Adding it shouldn't be that big a deal tho. If you are so inclined yourself, you could open a PR against the Ansible libraries yourself, otherwise just open a GitHub issue so we know we need to add this in:
Thanks, I'll open an issue at Git.
But in general, is there a way to disable tunnel via API? If there is, I'd like to test that, since couldn't find anything yet browsing palo api.
There is (replace
foobar below with the real name of your IPSec tunnel):
If you look at the code of the Ansible playbook, it's actually statically setting this param to
False when it performs the configuration. This is why I said that making this addition shouldn't be too hard.
The reason I started this thread is that this one didn't work :)
tried from /api of the FW:
Didn't work either
With all those I get
The xpath that I gave (and that the CLI is reporting) is the correct one. You just need to give all the rest of the usual PAN-OS XML API params and it will work:
key: <your api key here>
One other thing I'll mention: I don't know how you're doing these API calls, but I think it's time to plug pandevice at this point.
Doing this with pandevice is pretty straight forward:
from pandevice.firewall import Firewall
from pandevice.network import IpsecTunnel
fw = Firewall('192.168.1.1', 'admin', 'admin')
tun = IpsecTunnel('foobar')
tun.disabled = True
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 Live Community as a whole!
The Live Community thanks you for your participation!