Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error with Arch Linux because of python3 #45

Open
hikaru-shindo opened this issue May 26, 2017 · 1 comment
Open

Error with Arch Linux because of python3 #45

hikaru-shindo opened this issue May 26, 2017 · 1 comment

Comments

@hikaru-shindo
Copy link

Hi there,

this role won't work on arch linux because /usr/bin/python (which is used by ansible-playbook) is version 3.6.1 currently.

This leads to the following error using this role:

TASK [chrismeyersfsu.provision_docker : Make sure able to connect to hosts] ******************

The full traceback is:
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/ansible/executor/task_executor.py", line 97, in run
    item_results = self._run_loop(items)
  File "/usr/lib/python3.6/site-packages/ansible/executor/task_executor.py", line 290, in _run_loop
    res = self._execute(variables=task_vars)
  File "/usr/lib/python3.6/site-packages/ansible/executor/task_executor.py", line 472, in _execute
    self._connection = self._get_connection(variables=variables, templar=templar)
  File "/usr/lib/python3.6/site-packages/ansible/executor/task_executor.py", line 729, in _get_connection
    connection = self._shared_loader_obj.connection_loader.get(conn_type, self._play_context, self._new_stdin)
  File "/usr/lib/python3.6/site-packages/ansible/plugins/__init__.py", line 373, in get
    obj = obj(*args, **kwargs)
  File "/usr/lib/python3.6/site-packages/ansible/plugins/connection/docker.py", line 78, in __init__
    docker_version = self._get_docker_version()
  File "/usr/lib/python3.6/site-packages/ansible/plugins/connection/docker.py", line 138, in _get_docker_version
    for line in cmd_output.split('\n'):
TypeError: a bytes-like object is required, not 'str'

fatal: [localhost]: FAILED! => {
    "failed": true,
    "msg": "Unexpected failure during module execution.",
    "stdout": ""
}

Manually setting /usr/bin/python2 as the executor for ansible-playbook works but that's not a neat soloution.

Also setting ansible_python_interpreter=/usr/bin/python2 won't work here too.

I am not too sure if the problem lies in ansible itself through.

Ansible version is:

ansible 2.3.0.0
config file = /etc/ansible/ansible.cfg
configured module search path = Default w/o overrides
python version = 3.6.1 (default, Mar 27 2017, 00:27:06) [GCC 6.3.1 20170306]

@chrismeyersfsu
Copy link
Owner

The problem is that the docker module hasn't been ported to work with python3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants