hi,
I wrote a simple shell script and made it as Ansible module with putting
it under Library Path. I ran the module and got the failure message.
However, I can tell from the output message that the shell module has been
run actually. So I don't understand why Ansible returns such failure
message.
*Below has the detail, the OS type of target system is AIX*
*root@b1a52ef5f33f:/usr/share/my_modules# ansible aix -m getos*
*9.123.195.164 | FAILED! => {*
* "changed": false,*
* "failed": true,*
* "module_stderr": "",*
* "module_stdout": "AIX lpar1 1 7 00CB4D6E4C00\r\n",*
* "msg": "MODULE FAILURE",*
* "parsed": false*
*}*
*root@b1a52ef5f33f:/usr/share/my_modules# cat getos*
*#!/bin/sh*
*uname -a*
Meanwhile, I used the test-module utility to test my shell module and see
error with "ValueError: No JSON object could be decoded". So I assume that
is the root cause maybe.
root@b1a52ef5f33f:/ansible# hacking/test-module -m
/usr/share/my_modules/getos
* including generated source, if any, saving to:
/root/.ansible_module_generated
* this may offset any line numbers in tracebacks/debuggers!
***********************************
RAW OUTPUT
Linux b1a52ef5f33f 4.1.13-boot2docker #1 SMP Fri Nov 20 19:05:50 UTC 2015
x86_64 x86_64 x86_64 GNU/Linux
***********************************
INVALID OUTPUT FORMAT
Linux b1a52ef5f33f 4.1.13-boot2docker #1 SMP Fri Nov 20 19:05:50 UTC 2015
x86_64 x86_64 x86_64 GNU/Linux
Traceback (most recent call last):
File "hacking/test-module", line 167, in runtest
results = json.loads(out)
File "/usr/lib/python2.7/json/__init__.py", line 338, in loads
return _default_decoder.decode(s)
File "/usr/lib/python2.7/json/decoder.py", line 366, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python2.7/json/decoder.py", line 384, in raw_decode
raise ValueError("No JSON object could be decoded")
*ValueError: No JSON object could be decoded*
I'm not sure whether i am right. But even so, i still have no idea how to
solve my problem.
Would you please help me out? Thanks very much
--
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/e998ddec-02b2-42ba-ba76-2c44ed5f5ba6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.