Good day,
I’m utilizing slurp to pull an XML file from a remote Windows host to lookup some values. In the file there are a couple of Windows paths that when grabbed via regex_search are returned with various escape sequences. For example, \a becomes \u0007.
Any ideas how I can resolve the below? I cannot install anything on the remote host, and I cannot pull files locally. This rules out using any of the XML modules.
Example for clarity:
file.xml:
<?xml version="1.0" encoding="utf-8"?> ... \\somewhere.com\adata\aclusters\bytes ...Task:
- name: Create dictionary of values from test.xml
ansible.builtin.set_fact:
file_xml_data: ‘{{ file_xml_data | default({}) | combine({item.key: item.value}) }}’
loop:
… - “{ ‘key’: ‘cifs_share’, ‘value’:
‘{{ file_xml | regex_search(’(.+)</‘, ‘\1’) | first }}’ }”
…
Appreciate any ideas you may have.
Thank you.