robertdebock / ansible-role-docker_ce

Install and configure Docker CE on your system.
https://robertdebock.nl/
Apache License 2.0
11 stars 7 forks source link

Add architecture distinction with ansible_architecture for debian-like dists #2

Closed fzarifian closed 5 years ago

fzarifian commented 5 years ago

Signed-off-by: Fabien ZARIFIAN fabien.zarifian@nuevolia.fr


name: Pull request about: Describe the proposed change


Describe the change When installing on non amd64 on Debian-like distribution, docker installation should not work.

From my infrastructure :

testhost$ ansible all -m command -a "dpkg --print-architecture"
test-amd64-ansible | CHANGED | rc=0 >>
amd64

test-arm64-ansible | CHANGED | rc=0 >>
arm64

test-armhf-ansible | CHANGED | rc=0 >>
armhf
testhost$ ansible all -m setup -a filter=ansible_architecture
test-amd64-ansible | SUCCESS => {
    "ansible_facts": {
        "ansible_architecture": "x86_64"
    },
    "changed": false
}
test-arm64-ansible | SUCCESS => {
    "ansible_facts": {
        "ansible_architecture": "aarch64"
    },
    "changed": false
}
test-armhf-ansible | SUCCESS => {
    "ansible_facts": {
        "ansible_architecture": "armv7l"
    },
    "changed": false
}
Playbook run took 0 days, 0 hours, 0 minutes, 9 seconds

Testing No idea how to test this with travis-ci

robertdebock commented 5 years ago

Cool addition, it will be tested somewhere later today.

After successful testing I'll merge.

Thanks @fzarifian!

fzarifian commented 5 years ago

A pleasure to contribute on your great job :)

robertdebock commented 5 years ago

Testing fails. If I'm correct, you have a list:

_docker_ce_arches:
  - default: amd64
  - x86_64: amd64
  - aarch64: arm64
  - armv7l: armhf
  - s390x: s390x
  - ppc64le: ppc64le

That should be a dictionary:

_docker_ce_arches:
  default: amd64
  x86_64: amd64
  aarch64: arm64
  armv7l: armhf
  s390x: s390x
  ppc64le: ppc64le

Please retry an extra commit.

You can also test locally using molecule test.

fzarifian commented 5 years ago

fixed :)

should fail with centos-6 :

TASK [robertdebock.python_pip : update setuptools] *****************************
FAILED - RETRYING: update setuptools (3 retries left).
FAILED - RETRYING: update setuptools (2 retries left).
FAILED - RETRYING: update setuptools (1 retries left).
fatal: [docker_ce-centos-6]: FAILED! => {"attempts": 3, "changed": false, "cmd": ["/usr/bin/pip2", "install", "setuptools"], "msg": "\n:stderr: Traceback (most recent call last):\n  File \"/usr/bin/pip2\", line 7, in <module>\n    from pip._internal import main\n  File \"/usr/lib/python2.6/site-packages/pip/_internal/__init__.py\", line 19, in <module>\n    from pip._vendor.urllib3.exceptions import DependencyWarning\n  File \"/usr/lib/python2.6/site-packages/pip/_vendor/urllib3/__init__.py\", line 8, in <module>\n    from .connectionpool import (\n  File \"/usr/lib/python2.6/site-packages/pip/_vendor/urllib3/connectionpool.py\", line 92\n    _blocking_errnos = {errno.EAGAIN, errno.EWOULDBLOCK}\n                                    ^\nSyntaxError: invalid syntax\n"}

PLAY RECAP *********************************************************************
docker_ce-centos-6         : ok=21   changed=7    unreachable=0    failed=1   
robertdebock commented 5 years ago

Great job! Ready to merge.

pip does not work on CentOS-6, that's a know issue.