Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting an empty value fails with MODULE FAILURE #63

Closed
mss opened this issue May 25, 2016 · 5 comments
Closed

Setting an empty value fails with MODULE FAILURE #63

mss opened this issue May 25, 2016 · 5 comments
Labels

Comments

@mss
Copy link

mss commented May 25, 2016

This might be the same issue as #53 and maybe #7.

The XML:

<?xml version='1.0' encoding='UTF-8'?>
<localconfig>
  <key name="smtp_notify">
    <value>yes</value>
  </key>
</localconfig>

This task works to set the value above:

  - name: Set localconfig options
    xml:
      file: "/opt/zimbra/conf/localconfig.xml"
      xpath: "/localconfig/key[@name='smtp_notify']/value"
      value: "yes"

But this fails:

  - name: Set localconfig options
    xml:
      file: "/opt/zimbra/conf/localconfig.xml"
      xpath: "/localconfig/key[@name='smtp_notify']/value"
      value: ""

Expected result:

<?xml version='1.0' encoding='UTF-8'?>
<localconfig>
  <key name="smtp_notify">
    <value></value>
  </key>
</localconfig>

Actual result:

TASK [Set localconfig options] *************************************************
fatal: [zmdir2.example.com]: FAILED! => {"changed": false, "failed": true, "module_stderr": "", "module_stdout": "", "msg": "MODULE FAILURE", "parsed": false}

This is version 0.3.1 if I'm not mistaken (whatever was current on galaxy today).

@mss
Copy link
Author

mss commented May 30, 2016

Hmm… was this maybe fixed with #60?

@pigulla
Copy link

pigulla commented Sep 28, 2016

This is still broken :-(

@dagwieers
Copy link
Collaborator

The xml module is upstream now (and ships with Ansible v2.4).

Please close this issue, and retest against the new upstream xml module. If needed, open a new issue at: https://github.com/ansible/ansible/issues

@mss
Copy link
Author

mss commented Aug 9, 2017

This is fixed in the version which is shipped with Ansible v2.4.

Tested with the XML file from the initial report and following playbook:

---
- hosts: all
  tasks:
  - name: Set localconfig options
    xml:
      file: "/tmp/localconfig.xml"
      xpath: "/localconfig/key[@name='smtp_notify']/value"
      value: ""

@mss mss closed this as completed Aug 9, 2017
@dagwieers
Copy link
Collaborator

Thanks for reporting back !

@dagwieers dagwieers added the bug label Jan 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants