xml

Collection: community.general

Full Name: parallax.community.general.xml

Aliases: community.general.xml, xml

Synopsis

Manage xml

Parameters

NameTypeRequiredDefaultDescription
pathstringyesPath to the XML file to manage
xpathstringyesXPath expression to select elements
valuestringThe value to set for the selected element
attributestringThe attribute to set on the selected element
statestringpresentWhether the element should be present or absent Choices: present, absent
contentstringtextType of content to set: text or attribute Choices: text, attribute
namespacesstringNamespace mappings as comma-separated prefix=uri pairs
pretty_printbooltruePretty print the XML output
backupboolfalseCreate a backup file before modifying

Example

- name: Example xml task
  xml:
    path: <your_path>
    xpath: <your_xpath>