Open gevezex opened 2 years ago
Files identified in the description:
If these files are incorrect, please update the component name
section of the description or use the !component
bot command.
cc @cmprescott @dagwieers @sm4rk0 @tbielawa click here for bot help
hi @gevezex Thanks for submitting this issue.
I haven't used the xml
module myself, but taking a look at the docs it seems that:
option content
will give you the current state of the XML doc. Based on the results of that, you can have your playbook changing the attribute or not.
Keep in mind that Ansible modules are meant to be idempotent, so expressing a desired state will produce that outcome, regardless of the initial state.
Files identified in the description:
If these files are incorrect, please update the component name
section of the description or use the !component
bot command.
Summary
I am trying to change an attribute, only if the xpath exists. This works as designed if the xpath has a match. But if there is no xpath match then it creates also the element, what is not desired in my case. How can I change this default behaviour.
Issue Type
Documentation Report
Component Name
xml
Ansible Version
ansible [core 2.13.3] config file = /etc/ansible/ansible.cfg configured module search path = ['/home/dbxaci0/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /home/dbxaci0/miniconda3/lib/python3.9/site-packages/ansible ansible collection location = /home/dbxaci0/.ansible/collections:/usr/share/ansible/collections executable location = /home/dbxaci0/miniconda3/bin/ansible python version = 3.9.12 (main, Apr 5 2022, 06:56:58) [GCC 7.5.0] jinja version = 3.1.2 libyaml = True
Community.general Version
Configuration
OS / Environment
No response
Additional Information
No response
Code of Conduct