# Ansible playbook xml module - error when using in task

**URL:** <https://forum.ansible.com/t/ansible-playbook-xml-module-error-when-using-in-task/25649>\
**Category:** Ansible Project\
**Tags:** windows\
**Created:** [October 1, 2017, 5:41am UTC](https://forum.ansible.com/t/ansible-playbook-xml-module-error-when-using-in-task/25649 "2017-10-01T05:41:10Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sivakumar\_Lakshminar](https://avatars.discourse-cdn.com/v4/letter/s/c5a1d2/32.png) [@Sivakumar\_Lakshminar](https://forum.ansible.com/u/Sivakumar_Lakshminar)\
**Post date:** [October 1, 2017, 5:41am UTC](https://forum.ansible.com/t/ansible-playbook-xml-module-error-when-using-in-task/25649/1 "2017-10-01T05:41:10Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Andreas\_Olsson](https://avatars.discourse-cdn.com/v4/letter/a/ba9def/32.png) [@Andreas\_Olsson](https://forum.ansible.com/u/Andreas_Olsson)\
**Post date:** [October 1, 2017, 11:23am UTC](https://forum.ansible.com/t/ansible-playbook-xml-module-error-when-using-in-task/25649/2 "2017-10-01T11:23:27Z")

</div>

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](https://docs.ansible.com/ansible/latest/xml_module.html)  
the xml module wasn't introduced until Ansible 2.4.

// Andreas

---

<div class="post-metadata">

**Author:** ![Sivakumar\_Lakshminar](https://avatars.discourse-cdn.com/v4/letter/s/c5a1d2/32.png) [@Sivakumar\_Lakshminar](https://forum.ansible.com/u/Sivakumar_Lakshminar)\
**Post date:** [October 2, 2017, 3:04pm UTC](https://forum.ansible.com/t/ansible-playbook-xml-module-error-when-using-in-task/25649/3 "2017-10-02T15:04:43Z")

</div>

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

Thanks

---

<div class="post-metadata">

**Author:** ![Dick\_Davies](https://avatars.discourse-cdn.com/v4/letter/d/b9e5f3/32.png) [@Dick\_Davies](https://forum.ansible.com/u/Dick_Davies)\
**Post date:** [October 2, 2017, 3:48pm UTC](https://forum.ansible.com/t/ansible-playbook-xml-module-error-when-using-in-task/25649/4 "2017-10-02T15:48:11Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Sivakumar\_Lakshminar](https://avatars.discourse-cdn.com/v4/letter/s/c5a1d2/32.png) [@Sivakumar\_Lakshminar](https://forum.ansible.com/u/Sivakumar_Lakshminar)\
**Post date:** [October 6, 2017, 1:06am UTC](https://forum.ansible.com/t/ansible-playbook-xml-module-error-when-using-in-task/25649/5 "2017-10-06T01:06:43Z")

</div>

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.
