Skip to content
This repository has been archived by the owner on Oct 30, 2018. It is now read-only.

Add new module for manipulating XML files #4112 #4122

Closed
wants to merge 1 commit into from

Conversation

cmprescott
Copy link

ISSUE TYPE
  • New Module Pull Request
COMPONENT NAME

files/xml

ANSIBLE VERSION
ansible 2.1.0.0
  config file = 
  configured module search path = Default w/o overrides
SUMMARY

New module for manipulating xml files. Multiple asks to have this included with ansible instead of in its own repo.

Fixes #4112

ansible 2.1.0.0
  config file = 
  configured module search path = Default w/o overrides

- Used python from https://github.com/cmprescott/ansible-xml/tree/0.3.4
- Did not include unit tests because does not seem like a natural place for them
@abadger
Copy link
Contributor

abadger commented Jul 7, 2016

This probably needs to go to ansible-modules-extras first and then be brought into core if it proves to be a module that is robust and widely needed.

I'll post some comments against the code here since I'm going away for a few days of vacation and might not see it when you repost it in ansible-modules-extras.

@abadger abadger closed this Jul 7, 2016
short_description: Manage bits and pieces of XML files or strings
description:
- A CRUD-like interface to managing bits of XML flies. You might also be interested in a brief tutorial, U(http://www.w3schools.com/xpath/). Note that module this does not handle complicated xpath expressions. So limit xpath selectors to simple expressions.
version_added: "1.0"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

version_added is the version it's first shipped with ansible. At the moment we're working on version 2.2.

@abadger
Copy link
Contributor

abadger commented Jul 7, 2016

@cmprescott Okay, I've gone through the code and added some basic style and guidelines compliance notes. I haven't run the module or checked that it functions well so when other people review they may find more things to change.

Since I'm rusty on my lxml API... is this module idempotent? If I ask to add to in my playbook and then run the playbook twice, will I end up with (idempotent):

<node><subnode/></node>

or (nonidempotent):

<node><subnode/><subnode/></node>

?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

New core module submission: XML
2 participants