Ansible playbook xml module - error when using in task

Hello All,

I am new to this group and ansible as well. I am learning ansible for my current project, till now all going good.
Now I need to parse and update xml’s using path in remote windows machine.
When trying ansible xml module (installed lxml using the command sudo pip install lxml) I am getting below error,

Code snippet in my task,

  • name: update sample xml
    xml:
    path: “c:\temp1\sample.xml”
    xpath: “/PARTS/TITLE”
    value: “testing success!!!”

Error,

Sivakumars-MacBook-Pro:ansible keerthisiva$ ansible-playbook -i hosts -l ccenter,windows site.yml
ERROR! no action detected in task. This often indicates a misspelled module name, or incorrect module path.

I am using Mac 10.12.6 as my host machine.

ansible --version

ansible 2.3.1.0
config file = /Users/keerthisiva/Documents/workbench/projects/ansible/ansible.cfg
configured module search path = Default w/o overrides
python version = 2.7.10 (default, Feb 7 2017, 00:08:15) [GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.34)]

Can some one help in directing me on this issue.

Thanks,
Sivakumar

lör 2017-09-30 klockan 22:41 -0700 skrev Sivakumar Lakshminarayanan:

When trying ansible xml module...
...
...
ansible 2.3.1.0

According to https://docs.ansible.com/ansible/latest/xml_module.html
the xml module wasn't introduced until Ansible 2.4.

// Andreas

Sorry missed to see that, my bad.
Bad luck in our office repository we will have ansible 2.3* only.

Thanks

If you just create a library/ folder and put the xml module in there,
it'll work.

We've been using the xml module since 2.0 this way, it works fine.

Thanks, let me try that.
Actually I upgraded 2.4 and tried xml it is working fine when it comes to Linux client machines.
But with windows client machines I have issues as getting some HTTP error, will try your option of holding win_xml in library and try.