Running into an issue on my Ubuntu 14.04 EC2 instances. I install ansible via user data and apt-get. When I invoke ansible-pull in my user data I’m seeing this failure:
<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: root
<127.0.0.1> EXEC /bin/sh -c ‘( umask 77 && mkdir -p “echo $HOME/.ansible/tmp/ansible-tmp-1475247256.84-242920278111573
” && echo ansible-tmp-1475247256.84-242920278111573=“echo $HOME/.ansible/tmp/ansible-tmp-1475247256.84-242920278111573
” ) && sleep 0’
<127.0.0.1> PUT /tmp/tmp4vNPru TO /.ansible/tmp/ansible-tmp-1475247256.84-242920278111573/cron
<127.0.0.1> EXEC /bin/sh -c ‘chmod u+x /.ansible/tmp/ansible-tmp-1475247256.84-242920278111573/ /.ansible/tmp/ansible-tmp-1475247256.84-242920278111573/cron && sleep 0’
<127.0.0.1> EXEC /bin/sh -c ‘LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 /usr/bin/python /.ansible/tmp/ansible-tmp-1475247256.84-242920278111573/cron; rm -rf “/.ansible/tmp/ansible-tmp-1475247256.84-242920278111573/” > /dev/null 2>&1 && sleep 0’
An exception occurred during task execution. The full traceback is:
Traceback (most recent call last):
File “/tmp/ansible_X_9Q8w/ansible_module_cron.py”, line 700, in
main()
File “/tmp/ansible_X_9Q8w/ansible_module_cron.py”, line 575, in main
crontab = CronTab(module, user, cron_file)
File “/tmp/ansible_X_9Q8w/ansible_module_cron.py”, line 233, in init
self.read()
File “/tmp/ansible_X_9Q8w/ansible_module_cron.py”, line 251, in read
(rc, out, err) = self.module.run_command(self._read_user_execute(), use_unsafe_shell=True)
File “/tmp/ansible_X_9Q8w/ansible_module_cron.py”, line 480, in _read_user_execute
elif os.getlogin() != self.user:
OSError: [Errno 25] Inappropriate ioctl for device
fatal: [localhost]: FAILED! => {“changed”: false, “failed”: true, “invocation”: {“module_name”: “cron”}, “module_stderr”: “Traceback (most recent call last):\n File "/tmp/ansible_X_9Q8w/ansible_module_cron.py", line 700, in \n main()\n File "/tmp/ansible_X_9Q8w/ansible_module_cron.py", line 575, in main\n crontab = CronTab(module, user, cron_file)\n File "/tmp/ansible_X_9Q8w/ansible_module_cron.py", line 233, in init\n self.read()\n File "/tmp/ansible_X_9Q8w/ansible_module_cron.py", line 251, in read\n (rc, out, err) = self.module.run_command(self._read_user_execute(), use_unsafe_shell=True)\n File "/tmp/ansible_X_9Q8w/ansible_module_cron.py", line 480, in _read_user_execute\n elif os.getlogin() != self.user:\nOSError: [Errno 25] Inappropriate ioctl for device\n”, “module_stdout”: “”, “msg”: “MODULE FAILURE”}
If I login to my instance after this failure and run the ansible-pull command manually it proceeds without failure, due to this I’m assuming it’s related to this bugfix:
https://github.com/ansible/ansible-modules-core/pull/4777
Anyone else seeing this issue?