My library modules stopped working after 1.8

51 views
Skip to first unread message

mto...@go2uti.com

unread,
Apr 16, 2015, 7:51:27 PM4/16/15
to ansible...@googlegroups.com

 Prior to release 1.8, a module named 'mytest' that contained the following worked perfectly:

#!/bin/ksh

echo 'changed=True msg=OK'
exit 0

The command 'ansible server -m mytest -M my_library' would return:

server | success >> {
    "changed": true,
    "msg": "OK"
}

But as of release 1.8, the same command returns:

server | FAILED >> {
    "failed": true,
    "msg": "changed=True msg=OK\r\n",
    "parsed": false
}

So, what changed and what must I do to make it all work again?  I have looked but can't seem to locate any mention of anything about this in the release notes.  It is probably there and I am just not recognizing it.  Can somebody please direct me to where I can find information on this?
Thanks,
-Mark

Matt Martz

unread,
Apr 16, 2015, 8:36:15 PM4/16/15
to ansible...@googlegroups.com
"BabyJSON" as it was called was removed in 1.8.  As such, modules must return actual JSON in responses and not the key=value responses.
--
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/e0fbc79e-e805-43e6-859b-f1bdfd161817%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
Matt Martz
@sivel
sivel.net

mto...@go2uti.com

unread,
Apr 16, 2015, 11:21:51 PM4/16/15
to ansible...@googlegroups.com

 Okay, that explains it.  Now can you point me at a good reference that will explain what that should look like?  Obviously, I am not familiar with it.
Thanks,
-Mark




On Thursday, April 16, 2015 at 5:36:15 PM UTC-7, Matt Martz wrote:
"BabyJSON" as it was called was removed in 1.8.  As such, modules must return actual JSON in responses and not the key=value responses.

On Thursday, April 16, 2015, <mto...@go2uti.com> wrote:

 Prior to release 1.8, a module named 'mytest' that contained the following worked perfectly:

#!/bin/ksh

echo 'changed=True msg=OK'
exit 0

The command 'ansible server -m mytest -M my_library' would return:

server | success >> {
    "changed": true,
    "msg": "OK"
}

But as of release 1.8, the same command returns:

server | FAILED >> {
    "failed": true,
    "msg": "changed=True msg=OK\r\n",
    "parsed": false
}

So, what changed and what must I do to make it all work again?  I have looked but can't seem to locate any mention of anything about this in the release notes.  It is probably there and I am just not recognizing it.  Can somebody please direct me to where I can find information on this?
Thanks,
-Mark

--
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-project+unsubscribe@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.

mto...@go2uti.com

unread,
Apr 16, 2015, 11:49:38 PM4/16/15
to ansible...@googlegroups.com



Found it.  This:

#!/bin/ksh

echo '{"changed": "True", "msg": "OK"}'
exit 0

now returns:

server | success >> {
    "changed": "True",
    "msg": "OK"
}

Easy enough to correct.
Thanks,
-Mark

mto...@go2uti.com

unread,
Apr 19, 2015, 12:34:48 AM4/19/15
to ansible...@googlegroups.com

This works even better.  I get the correct colors with this:


    #!/bin/ksh

    echo '{
        "changed": true,
        "msg": "OK"
    }'
    exit 0

-Mark
Reply all
Reply to author
Forward
0 new messages