Hello,
I'm using Ansible 1.7.2 and I've written a Bash module to use at a very
early stage of Linux installation (Python not fully available yet). It
works correctly except that the return value is seen as stdout and is not
interpreted as a special value (changed, failed, skipped, ok).
*my_playbook.yml*:
[...]
- name: my action
shell: /path/to/my_action.sh {{ my_arg }}
when: my_arg is defined
[...]
*my_action.sh*:
[...]
echo 'ok: true'
exit 0
[...]
*Execution*:
[root@my_host] # ansible-playbook -v -l $(hostname -s) -c local
/path/to/my_playbook.yml
[...]
TASK: [my action]
*************************************************************
changed: [my_host] => {"changed": true, "cmd": "/path/to/my_action.sh
my_arg", "delta": "0:00:00.255756", "end": "2015-04-22 15:54:57.077314",
"rc": 0, "start": "2015-04-22 15:54:56.821558", "stderr": "", "stdout": "ok:
true"}
[...]
In the execution, you can read "ok: true" in stdout. I would like to get it
instead of "changed": true. I tried many different syntaxes to tell Ansible
I had no change in the script, without any success:
echo '{"ok": "true"}'
echo '{ok=True}'
echo 'ok: True'
echo 'ok=True'
echo 'ok=true'
...
What did I do wrong? Thanks in advance for your explanations.
--
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/e8dc8f0d-a771-4fe3-9b2c-14b8c2afa977%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.