New in version 2.7.
Parameter | Choices/Defaults | Comments |
---|---|---|
attribute | The attribute name if the type is 'attribute'. Required if type=attribute . | |
backup bool |
| Whether to backup the remote server's XML before applying the change. |
fragment required | The string representation of the XML fragment to be added. aliases: xmlstring | |
path required | The path of remote servers XML. aliases: dest, file | |
type required |
| The type of XML you are working with. |
xpath required | The node of the remote server XML where the fragment will go. |
# Apply our filter to Tomcat web.xml - win_xml: path: C:\apache-tomcat\webapps\myapp\WEB-INF\web.xml fragment: '<filter><filter-name>MyFilter</filter-name><filter-class>com.example.MyFilter</filter-class></filter>' xpath: '/*' # Apply sslEnabledProtocols to Tomcat's server.xml - win_xml: path: C:\Tomcat\conf\server.xml xpath: '//Server/Service[@name="Catalina"]/Connector[@port="9443"]' attribute: 'sslEnabledProtocols' fragment: 'TLSv1,TLSv1.1,TLSv1.2' type: attribute
Common return values are documented here, the following are the fields unique to this module:
Key | Returned | Description |
---|---|---|
backup string | changed | name of the backup file, if created Sample: C:\config.xml.19700101-000000 |
err list | always, for type element and -vvv or more | xml comparison exceptions Sample: attribute mismatch for actual=string |
msg string | always | what was done Sample: xml added |
This module is flagged as preview which means that it is not guaranteed to have a backwards compatible interface.
This module is flagged as community which means that it is maintained by the Ansible Community. See Module Maintenance & Support for more info.
For a list of other modules that are also maintained by the Ansible Community, see here.
Hint
If you notice any issues in this documentation you can edit this document to improve it.
© 2012–2018 Michael DeHaan
© 2018 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/2.7/modules/win_xml_module.html