Ansible playbook xml module - error when using in task

896 views
Skip to first unread message

Sivakumar Lakshminarayanan

unread,
Oct 1, 2017, 1:41:10 AM10/1/17
to Ansible Project
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

Andreas Olsson

unread,
Oct 1, 2017, 7:23:48 AM10/1/17
to ansible...@googlegroups.com
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

Sivakumar Lakshminarayanan

unread,
Oct 2, 2017, 11:04:43 AM10/2/17
to Ansible Project
Sorry missed to see that, my bad.
Bad luck in our office repository we will have ansible 2.3* only.

Thanks

Dick Davies

unread,
Oct 2, 2017, 11:48:26 AM10/2/17
to ansible list
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.

On 2 October 2017 at 16:04, Sivakumar Lakshminarayanan
> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ansible-proje...@googlegroups.com.
> To post to this group, send email to ansible...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/15f6efc4-fc9e-4f66-aeaa-4fa408d0032f%40googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.

Sivakumar Lakshminarayanan

unread,
Oct 5, 2017, 9:06:44 PM10/5/17
to Ansible Project
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.
Reply all
Reply to author
Forward
0 new messages