You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I try to use the xml module with xpath to only make changes to matching values in an xml file I get a modification made on an xpath that should not be matching. When run in --check --diff mode it looks like only the matched xpaths will be touched but when actually run the results are different as shared below.
Issue Type
Bug Report
Component Name
xml
Ansible Version
I tested with devel to be sure and was the same issue:
$ ansible --version[WARNING]: You are running the development version of Ansible. You should only run Ansible from "devel" if you are modifying the Ansible engine, or trying out features under development. This is a rapidly changing source of codeand can become unstable at any point.ansible [core 2.18.0.dev0] config file = None configured module search path = ['/home/<redacted>/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /home/<redacted>/ansible_bug_report/lib64/python3.11/site-packages/ansible ansible collection location = /home/<redacted>/.ansible/collections:/usr/share/ansible/collections executable location = /home/tylere/ansible_bug_report/bin/ansible python version = 3.11.7 (main, Jul 4 2024, 00:00:00) [GCC 11.4.1 20231218 (Red Hat 11.4.1-3)] (/home/<redacted>/ansible_bug_report/bin/python) jinja version = 3.1.4 libyaml = True
Community.general Version
$ ansible-galaxy collection list community.general[WARNING]: You are running the development version of Ansible. You should only run Ansible from "devel" if you are modifying the Ansible engine, or trying out features under development. This is a rapidly changing source of codeand can become unstable at any point.
# /home/<redacted>/.ansible/collections/ansible_collectionsCollection Version----------------- -------community.general 9.2.0
Configuration
$ ansible-config dump --only-changedansible-config dump --only-changed[WARNING]: You are running the development version of Ansible. You should only run Ansible from "devel" if you are modifying the Ansible engine, or trying out features under development. This is a rapidly changing source of codeand can become unstable at any point.CONFIG_FILE() = NoneDEFAULT_TRANSPORT(env: ANSIBLE_TRANSPORT) = localGALAXY_SERVERS:
But when actually run it can be seen at first it goes along matching on the fist two connection-url'but then it changes a random </datasource> line before going back to doing connection-url matches. Due to this random match it then continues to add to this mismatched line:
Summary
When I try to use the xml module with xpath to only make changes to matching values in an xml file I get a modification made on an xpath that should not be matching. When run in --check --diff mode it looks like only the matched xpaths will be touched but when actually run the results are different as shared below.
Issue Type
Bug Report
Component Name
xml
Ansible Version
I tested with devel to be sure and was the same issue:
Community.general Version
Configuration
OS / Environment
RHEL9
Steps to Reproduce
Expected Results
I expected that the only changes made to the xml would be where matches were found with:
[text()='{{ item[0] }}']
When running in --check mode with --diff this seems to be what will happen:
Actual Results
But when actually run it can be seen at first it goes along matching on the fist two
connection-url
'but then it changes a random</datasource>
line before going back to doingconnection-url
matches. Due to this random match it then continues to add to this mismatched line:Code of Conduct
The text was updated successfully, but these errors were encountered: