Ansible module - selecting "None" value

Reply
Highlighted
L0 Member

Ansible module - selecting "None" value

I'm trying to create a tunnel interface using Ansible module panos_tunnel from  Galaxy role PaloAltoNetworks.paloaltonetworks

My playbook is failing because it cannot detect correct netflow-profile value. In my configuration I don't have any netflow-profile selected, so in GUI I'm selecting it as None. Through GUI this works just fine.

When I'm running my Ansible playbook I'm getting following error:

"msg": "Failed create:  tunnel.111 -> netflow-profile 'None' is not a valid reference\n tunnel.111 -> netflow-profile is invalid"

 I've tried running that same playbook with netflow-profile: null but it fails with another error

"msg": "Failed create:  tunnel.111 -> netflow-profile is invalid"

 Not setting parameter netflow-profile in module shows yet another error

"msg": "The task includes an option with an undefined variable. The error was: 'dict object' has no attribute 'netflow_profile'\n\nThe error appears to be in 'tunnel_interface.yml': line 20, column 10, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n  - name: Create tunnel interface\n    ^ here\n"

 

Is there a way to set that value in Ansible so that it will complete successfully or is it required to have specific Neflow-Profile created first, so that it doesn't use "None" ?


Accepted Solutions
Highlighted
L0 Member

Re: Ansible module - selecting "None" value

This was caused by error in my configuration.

In my playbook I had value for netflow-profile which was a reference to variable in another file. I've tried to set it to specific value and that failed. When original I've stated that I was removing value for netflow-profile what I was doing was to remove variable from that additional file and this was crashing due to non-existing variable.

Solution was to remove parameter netflow-profile from module panos_tunnel from my playbook.

View solution in original post


All Replies
Highlighted
L0 Member

Re: Ansible module - selecting "None" value

This was caused by error in my configuration.

In my playbook I had value for netflow-profile which was a reference to variable in another file. I've tried to set it to specific value and that failed. When original I've stated that I was removing value for netflow-profile what I was doing was to remove variable from that additional file and this was crashing due to non-existing variable.

Solution was to remove parameter netflow-profile from module panos_tunnel from my playbook.

View solution in original post

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 Live Community as a whole!

The Live Community thanks you for your participation!