community.general/test/integration/targets/xml/tasks/test-count.yml

14 lines
325 B
YAML

---
- name: Setup test fixture
copy:
src: '{{ role_path }}/fixtures/ansible-xml-beers.xml'
dest: /tmp/ansible-xml-beers.xml
- name: Add child element
xml:
path: /tmp/ansible-xml-beers.xml
xpath: /business/beers/beer
count: true
register: beers
failed_when: beers.count != 3