Class: Ansible::Ruby::Modules::Xml

Inherits:
Base show all
Defined in:
lib/ansible/ruby/modules/generated/files/xml.rb

Overview

A CRUD-like interface to managing bits of XML files. You might also be interested in a brief tutorial from U(www.w3schools.com/xml/xpath_intro.asp) and U(developer.mozilla.org/en-US/docs/Web/XPath).

Instance Method Summary collapse

Methods inherited from Base

#ansible_name, #to_h

Methods inherited from Ansible::Ruby::Models::Base

attr_option, attr_options, attribute, fix_inclusion, #initialize, remove_existing_validations, #to_h, validates

Constructor Details

This class inherits a constructor from Ansible::Ruby::Models::Base

Instance Method Details

#add_childrenArray<Hash>, ...

Returns Add additional child-element(s) to a selected element for a given C(xpath).,Child elements must be given in a list and each item may be either a string (eg. C(children=ansible) to add an empty C(<ansible/>) child element), or a hash where the key is an element name and the value is the element value.,This parameter requires C(xpath) to be set.

Returns:

  • (Array<Hash>, Hash, nil)

    Add additional child-element(s) to a selected element for a given C(xpath).,Child elements must be given in a list and each item may be either a string (eg. C(children=ansible) to add an empty C(<ansible/>) child element), or a hash where the key is an element name and the value is the element value.,This parameter requires C(xpath) to be set.



41
# File 'lib/ansible/ruby/modules/generated/files/xml.rb', line 41

attribute :add_children

#attributeString?

Returns The attribute to select when using parameter C(value).,This is a string, not prepended with C(@).

Returns:

  • (String, nil)

    The attribute to select when using parameter C(value).,This is a string, not prepended with C(@).



33
# File 'lib/ansible/ruby/modules/generated/files/xml.rb', line 33

attribute :attribute

#backup:yes, ...

Returns Create a backup file including the timestamp information so you can get the original file back if you somehow clobbered it incorrectly.

Returns:

  • (:yes, :no, nil)

    Create a backup file including the timestamp information so you can get the original file back if you somehow clobbered it incorrectly.



68
# File 'lib/ansible/ruby/modules/generated/files/xml.rb', line 68

attribute :backup

#content:attribute, ...

Returns Search for a given C(xpath) and get content.,This parameter requires C(xpath) to be set.

Returns:

  • (:attribute, :text, nil)

    Search for a given C(xpath) and get content.,This parameter requires C(xpath) to be set.



60
# File 'lib/ansible/ruby/modules/generated/files/xml.rb', line 60

attribute :content

#count:yes, ...

Returns Search for a given C(xpath) and provide the count of any matches.,This parameter requires C(xpath) to be set.

Returns:

  • (:yes, :no, nil)

    Search for a given C(xpath) and provide the count of any matches.,This parameter requires C(xpath) to be set.



48
# File 'lib/ansible/ruby/modules/generated/files/xml.rb', line 48

attribute :count

#input_type:xml, ...

Returns Type of input for C(add_children) and C(set_children).

Returns:

  • (:xml, :yaml, nil)

    Type of input for C(add_children) and C(set_children).



64
# File 'lib/ansible/ruby/modules/generated/files/xml.rb', line 64

attribute :input_type

#namespacesHash?

Returns The namespace C(prefix:uri) mapping for the XPath expression.,Needs to be a C(dict), not a C(list) of items.

Returns:

  • (Hash, nil)

    The namespace C(prefix:uri) mapping for the XPath expression.,Needs to be a C(dict), not a C(list) of items.



25
# File 'lib/ansible/ruby/modules/generated/files/xml.rb', line 25

attribute :namespaces

#pathString

Returns Path to the file to operate on. File must exist ahead of time.,This parameter is required, unless C(xmlstring) is given.

Returns:

  • (String)

    Path to the file to operate on. File must exist ahead of time.,This parameter is required, unless C(xmlstring) is given.



13
# File 'lib/ansible/ruby/modules/generated/files/xml.rb', line 13

attribute :path

#pretty_print:yes, ...

Returns Pretty print XML output.

Returns:

  • (:yes, :no, nil)

    Pretty print XML output.



56
# File 'lib/ansible/ruby/modules/generated/files/xml.rb', line 56

attribute :pretty_print

Returns Search for a given C(xpath) and print out any matches.,This parameter requires C(xpath) to be set.

Returns:

  • (:yes, :no, nil)

    Search for a given C(xpath) and print out any matches.,This parameter requires C(xpath) to be set.



52
# File 'lib/ansible/ruby/modules/generated/files/xml.rb', line 52

attribute :print_match

#set_childrenObject?

Returns Set the child-element(s) of a selected element for a given C(xpath).,Removes any existing children.,Child elements must be specified as in C(add_children).,This parameter requires C(xpath) to be set.

Returns:

  • (Object, nil)

    Set the child-element(s) of a selected element for a given C(xpath).,Removes any existing children.,Child elements must be specified as in C(add_children).,This parameter requires C(xpath) to be set.



45
# File 'lib/ansible/ruby/modules/generated/files/xml.rb', line 45

attribute :set_children

#state:absent, ...

Returns Set or remove an xpath selection (node(s), attribute(s)).

Returns:

  • (:absent, :present, nil)

    Set or remove an xpath selection (node(s), attribute(s)).



29
# File 'lib/ansible/ruby/modules/generated/files/xml.rb', line 29

attribute :state

#strip_cdata_tags:yes, ...

Returns Remove CDATA tags surrounding text values.,Note that this might break your XML file if text values contain characters that could be interpreted as XML.

Returns:

  • (:yes, :no, nil)

    Remove CDATA tags surrounding text values.,Note that this might break your XML file if text values contain characters that could be interpreted as XML.



72
# File 'lib/ansible/ruby/modules/generated/files/xml.rb', line 72

attribute :strip_cdata_tags

#valueInteger, ...

Returns Desired state of the selected attribute.,Either a string, or to unset a value, the Python C(None) keyword (YAML Equivalent, C(null)).,Elements default to no value (but present).,Attributes default to an empty string.

Returns:

  • (Integer, String, Date, nil)

    Desired state of the selected attribute.,Either a string, or to unset a value, the Python C(None) keyword (YAML Equivalent, C(null)).,Elements default to no value (but present).,Attributes default to an empty string.



37
# File 'lib/ansible/ruby/modules/generated/files/xml.rb', line 37

attribute :value

#xmlstringObject

Returns A string containing XML on which to operate.,This parameter is required, unless C(path) is given.

Returns:

  • (Object)

    A string containing XML on which to operate.,This parameter is required, unless C(path) is given.



17
# File 'lib/ansible/ruby/modules/generated/files/xml.rb', line 17

attribute :xmlstring

#xpathString?

Returns A valid XPath expression describing the item(s) you want to manipulate.,Operates on the document root, C(/), by default.

Returns:

  • (String, nil)

    A valid XPath expression describing the item(s) you want to manipulate.,Operates on the document root, C(/), by default.



21
# File 'lib/ansible/ruby/modules/generated/files/xml.rb', line 21

attribute :xpath