defunctzombie / ansible-coreos-bootstrap

[NOT MAINTAINED] bootstrap a coreos machine for control via ansible

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Doesn't seem to work with ansible > 2.0

edevil opened this issue · comments

Bootstrapping on ansible 2.0 produces:

TASK [defunctzombie.coreos-bootstrap : Check if we need to install pip] ********
fatal: [master1]: FAILED! => {"changed": false, "cmd": "PATH=/home/brpxuser/bin:$PATH python -m pip --version", "delta": "0:00:00.186103", "end": "2016-05-27 10:36:57.051637", "failed": true, "rc": 1, "start": "2016-05-27 10:36:56.865534", "stderr": "/home/brpxuser/pypy/bin/pypy: /lib64/libssl.so.1.0.0: no version information available (required by /home/brpxuser/pypy/bin/pypy)\n/home/brpxuser/pypy/bin/pypy: /lib64/libcrypto.so.1.0.0: no version information available (required by /home/brpxuser/pypy/bin/pypy)\n/home/brpxuser/pypy/bin/pypy: No module named pip", "stdout": "", "stdout_lines": [], "warnings": []}
...ignoring

TASK [defunctzombie.coreos-bootstrap : Copy get-pip.py] ************************
changed: [master1]

While bootstrapping on ansible 2.1 and 2.2:

TASK [defunctzombie.coreos-bootstrap : Check if we need to install pip] ********
fatal: [master1]: FAILED! => {"changed": false, "failed": true, "module_stderr": "", "module_stdout": "/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)\r\n/home/brpxuser/pypy/bin/pypy: /lib64/libssl.so.1.0.0: no version information available (required by /home/brpxuser/pypy/bin/pypy)\r\n/home/brpxuser/pypy/bin/pypy: /lib64/libcrypto.so.1.0.0: no version information available (required by /home/brpxuser/pypy/bin/pypy)\r\n/bin/sh: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)\r\nTraceback (most recent call last):\r\n  File \"app_main.py\", line 75, in run_toplevel\r\n  File \"/home/brpxuser/.ansible/tmp/ansible-tmp-1464345101.58-266085877590530/command\", line 114, in <module>\r\n    exitcode = invoke_module(module, zipped_mod, ZIPLOADER_PARAMS)\r\n  File \"/home/brpxuser/.ansible/tmp/ansible-tmp-1464345101.58-266085877590530/command\", line 28, in invoke_module\r\n    p = subprocess.Popen(['PATH=/home/brpxuser/bin:$PATH python', module], env=os.environ, shell=False, stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE)\r\n  File \"/home/brpxuser/pypy/lib-python/2.7/subprocess.py\", line 710, in __init__\r\n    errread, errwrite)\r\n  File \"/home/brpxuser/pypy/lib-python/2.7/subprocess.py\", line 1331, in _execute_child\r\n    raise child_exception\r\nOSError: [Errno 2] No such file or directory\r\n", "msg": "MODULE FAILURE", "parsed": false}
...ignoring

TASK [defunctzombie.coreos-bootstrap : Copy get-pip.py] ************************
fatal: [master1]: FAILED! => {"failed": true, "msg": "Failed to get information on remote file (/home/brpxuser/get-pip.py): MODULE FAILURE"}

It seems the script stopped working on recent ansible versions. Are there plans to update it?

I resolved this by specifying the path to the python executable specifically (instead of PATH=${PATH}:${HOME}/bin python). It now appears to be working correctly.

To investigate this further, I'd suggest appending -vvv to the command, which will give you the python stack trace.

@andrewhowdencom Yeah, that worked for me too. Thanks!

that worked for me !

commented

@andrewhowdencom Could you please elaborate what you changed exactly? Thanks in advance!

[coreos]
[coreos:vars]
ansible_python_interpreter="PATH=/home/core/bin:$PATH python"

Became

[coreos]
[coreos:vars]
ansible_python_interpreter="/root/bin/python" # This is still incorrect; no need to have it bootstrapped as root. 

Docs now reflect the accurate instructions, commit is here:

83e4729

commented

@andrewhowdencom Turns out that Ansible 2.0 behaves differently than 2.1. With 2.0 it was working, but with 2.1 not... After changing the path I at least don't see an error message for a missing Python interpreter anymore.

But now I got

FAILED! => {"changed": false, "cmd": "/home/core/bin/python -m pip --version", "delta": "0:00:00.038946", "end": "2016-08-17 09:41:57.982096", "failed": true, "rc": 1, "start": "2016-08-17 09:41:57.943150", "stderr": "/home/core/pypy/bin/pypy: /lib64/libssl.so.1.0.0: no version information available (required by /home/core/pypy/bin/pypy)\n/home/core/pypy/bin/pypy: /lib64/libcrypto.so.1.0.0: no version information available (required by /home/core/pypy/bin/pypy)\n/home/core/pypy/bin/pypy: No module named pip", "stdout": "", "stdout_lines": [], "warnings": []}

on CoreOS latest stable. Any clues? Thanks in advance!

I'm afraid not! I haven't looked at this recently. notable changes are

  • not gathering facts (gather_facts: no)
  • running as Sudo (thus the root line earlier)

Last image tested was 1010-5-0.