- Access exclusive content
- Connect with peers
- Share your expertise
- Find support resources
05-10-2023 03:56 AM
Hi all - I've been stuck trying to figure out a way to fix an issue I'm having while running this task in Ansible:
- name: Add existing local User to existing User Group
paloaltonetworks.panos.panos_type_cmd:
provider: "{{ provider }}"
cmd: set
xpath: |
/config/devices/entry[@name='localhost.localdomain']
/vsys/entry[@name='vsys2']/local-user-database
/user-group/entry[@name='TestGroup']/user
element: "<user>test_user</user>"
I'm trying to add an existing user to an existing group locally in the firewall and I keep getting this error:
"msg": "set failed, may need to override template object first"
It's weird because there aren't templates interfering with this configuration item.
And, to make it weirder, I can do it through the cli running: set vsys vsys4 local-user-database user-group TestGroup user test_user
Any clues or ideas? TIA
05-11-2023 12:43 AM
Hi @estebanad, I think you need <member> in your element, not <user>
element: "<member>test_user</member>"
In my non-VSYS test PA-Series (so hence a slightly different xpath), this worked:
- name: Add existing Local User to existing User Group
paloaltonetworks.panos.panos_type_cmd:
provider: "{{ device }}"
cmd: set
xpath: "/config/shared/local-user-database/user-group/entry[@name='TestGroup']/user"
element: "<member>test_user</member>"
Hope that helps
05-11-2023 12:43 AM
Hi @estebanad, I think you need <member> in your element, not <user>
element: "<member>test_user</member>"
In my non-VSYS test PA-Series (so hence a slightly different xpath), this worked:
- name: Add existing Local User to existing User Group
paloaltonetworks.panos.panos_type_cmd:
provider: "{{ device }}"
cmd: set
xpath: "/config/shared/local-user-database/user-group/entry[@name='TestGroup']/user"
element: "<member>test_user</member>"
Hope that helps
05-11-2023 02:49 PM
Hi @JimmyHolland , Yes!!! You are correct. I just tried `member` and it worked. I tried so many things, I'm not sure how I missed this one. Thanks a lot!
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!