Hello,
I'm having a problem with Ansible 1.8.4, which I'm running on a Macintosh to
remotely configure a host running on Amazon AWS. The command I'm using
to run a playbook is as follows:
ansible-playbook playbooks/site.yml -l
ec2-54-242-9-223.compute-1.amazonaws.com -v -s -i inventory/qa -e \{\"zoo_stage\":\"qa\",\"release_name\":\"20150602222150\"\} --skip-tags skip_during_zoo_boot
The playbook includes the following content:
- name: run decide_istore_action script
script: ../bin/decide_istore_action {{ instance_store_devices|join(" ") }} 2> /tmp/dave_debug_stderr | tee /tmp/dave_debug_stdout
register: istore_action
- debug: msg="istore action is ==>{{ istore_action.stdout }}<=="
The script writes only a single character 'F' (upper case letter F) to standard
output, which I am able to verify by inspecting the contents of
/tmp/dave_debug_stdout on the AWS host. However I see the following output
when the playbook executes:
TASK: [run decide_istore_action script] ***************************************
TASK: [debug msg="istore action is ==>{{ istore_action.stdout }}<=="] *********
}
Notice that the 'F' character written by the script is preceded by two error
messages and some additional text. Thus it appears that a bug in Ansible is
corrupting my script's output by injecting extra text before the script's actual
output. Does this problem look familiar to anyone, or does anyone have ideas
in the error message is the name of the EC2 instance, which was created
shortly before the playbook ran. I'm not sure whether the DNS lookup was
attempted on the Mac where the playbook was being executed from, or the
EC2 instance. However, shortly after observing the above behavior I logged
into the EC2 instance and did a DNS lookup, which failed:
Server: 172.16.0.23
Address: 172.16.0.23#53
dave@minsk:~$
After waiting a few minutes I tried the lookup again and it succeeded, so I guess
it took a while for the DNS change to propagate. So this raises two questions:
1. If the error message is the result of a DNS lookup attempted on the
EC2 host, why would Ansible be doing a lookup there just to run a local
command?
2. Why is the output getting mixed in with my script's standard output?
Any help anyone may be able to offer is greatly appreciated.
Thanks
Dave