@Kai Stian Olstad
Thanks for your answer: yes, it works.

@Felix Fontain
I have no XML skills. I nevertheless took a look at the ansible xml module, 
and it's obscure to me.
I think you're right though: it'd be better to read XML appropriately with 
that module rather than use some regex filter which can be easily defeated 
if the input changes in the future.
So I tried something, but of course it does not work (api_root_filename is 
the file containing the xml multi-line string):

- name: Reading RESTconf release 
  xml:
        attribute: rel
        content: attribute
        path: "{{ api_root_filename }}"
        xpath: /XRD/Link
  register: return_restconf_release

- name: Showing attribute value
  debug:
        var: return_restconf_release.matches[0].Link.rel

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/4dddbcb7-5adb-4cbc-8455-2f5c43418b4b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to