mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-25 11:51:26 -07:00
modules: fix examples to use FQCN (#644)
* modules: fix examples to use FQCN * fix * fix * fix
This commit is contained in:
parent
8b92e0454d
commit
41cfdda6a3
533 changed files with 2130 additions and 2130 deletions
|
@ -176,20 +176,20 @@ EXAMPLES = r'''
|
|||
# </business>
|
||||
|
||||
- name: Remove the 'subjective' attribute of the 'rating' element
|
||||
xml:
|
||||
community.general.xml:
|
||||
path: /foo/bar.xml
|
||||
xpath: /business/rating/@subjective
|
||||
state: absent
|
||||
|
||||
- name: Set the rating to '11'
|
||||
xml:
|
||||
community.general.xml:
|
||||
path: /foo/bar.xml
|
||||
xpath: /business/rating
|
||||
value: 11
|
||||
|
||||
# Retrieve and display the number of nodes
|
||||
- name: Get count of 'beers' nodes
|
||||
xml:
|
||||
community.general.xml:
|
||||
path: /foo/bar.xml
|
||||
xpath: /business/beers/beer
|
||||
count: yes
|
||||
|
@ -200,13 +200,13 @@ EXAMPLES = r'''
|
|||
|
||||
# Example where parent XML nodes are created automatically
|
||||
- name: Add a 'phonenumber' element to the 'business' element
|
||||
xml:
|
||||
community.general.xml:
|
||||
path: /foo/bar.xml
|
||||
xpath: /business/phonenumber
|
||||
value: 555-555-1234
|
||||
|
||||
- name: Add several more beers to the 'beers' element
|
||||
xml:
|
||||
community.general.xml:
|
||||
path: /foo/bar.xml
|
||||
xpath: /business/beers
|
||||
add_children:
|
||||
|
@ -215,7 +215,7 @@ EXAMPLES = r'''
|
|||
- beer: Old Curmudgeon
|
||||
|
||||
- name: Add several more beers to the 'beers' element and add them before the 'Rochefort 10' element
|
||||
xml:
|
||||
community.general.xml:
|
||||
path: /foo/bar.xml
|
||||
xpath: '/business/beers/beer[text()="Rochefort 10"]'
|
||||
insertbefore: yes
|
||||
|
@ -226,17 +226,17 @@ EXAMPLES = r'''
|
|||
|
||||
# NOTE: The 'state' defaults to 'present' and 'value' defaults to 'null' for elements
|
||||
- name: Add a 'validxhtml' element to the 'website' element
|
||||
xml:
|
||||
community.general.xml:
|
||||
path: /foo/bar.xml
|
||||
xpath: /business/website/validxhtml
|
||||
|
||||
- name: Add an empty 'validatedon' attribute to the 'validxhtml' element
|
||||
xml:
|
||||
community.general.xml:
|
||||
path: /foo/bar.xml
|
||||
xpath: /business/website/validxhtml/@validatedon
|
||||
|
||||
- name: Add or modify an attribute, add element if needed
|
||||
xml:
|
||||
community.general.xml:
|
||||
path: /foo/bar.xml
|
||||
xpath: /business/website/validxhtml
|
||||
attribute: validatedon
|
||||
|
@ -244,7 +244,7 @@ EXAMPLES = r'''
|
|||
|
||||
# How to read an attribute value and access it in Ansible
|
||||
- name: Read an element's attribute values
|
||||
xml:
|
||||
community.general.xml:
|
||||
path: /foo/bar.xml
|
||||
xpath: /business/website/validxhtml
|
||||
content: attribute
|
||||
|
@ -255,13 +255,13 @@ EXAMPLES = r'''
|
|||
var: xmlresp.matches[0].validxhtml.validatedon
|
||||
|
||||
- name: Remove all children from the 'website' element (option 1)
|
||||
xml:
|
||||
community.general.xml:
|
||||
path: /foo/bar.xml
|
||||
xpath: /business/website/*
|
||||
state: absent
|
||||
|
||||
- name: Remove all children from the 'website' element (option 2)
|
||||
xml:
|
||||
community.general.xml:
|
||||
path: /foo/bar.xml
|
||||
xpath: /business/website
|
||||
children: []
|
||||
|
@ -276,7 +276,7 @@ EXAMPLES = r'''
|
|||
|
||||
# NOTE: There is the prefix 'x' in front of the 'bar' element, too.
|
||||
- name: Set namespaced '/x:foo/x:bar/y:baz/@z:my_namespaced_attribute' to 'false'
|
||||
xml:
|
||||
community.general.xml:
|
||||
path: foo.xml
|
||||
xpath: /x:foo/x:bar/y:baz
|
||||
namespaces:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue