Git Product home page Git Product logo

ansible-role-docker_arm's Introduction

Ansible Role: Docker for ARM

Deprecated: Please use geerlingguy.docker instead. On modern distributions, Docker should install just fine on Arm or X86 (or even RISC-V!) using that role.

CI

An Ansible Role that installs Docker on Linux, specially tailored for ARM-based computers like the Raspberry Pi.

Role Usage in Real-world projects

Besides the documentation here, please see the Raspberry Pi Dramble for an example of this role in action, being used with multiple Raspberry Pis to build a Kubernetes cluster, or Drupal Pi for an example of use with a single Raspberry Pi.

Requirements

If installing Docker Compose, requires Python Pip already be installed (you can use geerlingguy.pip to install it).

Role Variables

Available variables are listed below, along with default values (see defaults/main.yml):

docker_version: latest

The version of Docker to install. You can specify an exact version to lock it in (check for available versions with apt-cache madison docker-ce).

docker_install_recommends: false

Whether to install recommended packages alongside docker-ce.

docker_install_compose: true

Whether to install Docker Compose via Pip.

docker_users:
  - user1
  - user2

A list of system users to be added to the docker group (so they can use Docker on the server).

docker_pip_executable: pip3

Set this to pip for Python 2 or pip3 for Python 3.

Use with Ansible (and docker Python library)

Many users of this role wish to also use Ansible to then build Docker images and manage Docker containers on the server where Docker is installed. In this case, you can easily add in the docker Python library using the geerlingguy.pip role:

- hosts: rpi

  vars:
    pip_package: python3-pip
    pip_install_packages:
      - name: docker

  roles:
    - geerlingguy.pip
    - geerlingguy.docker_arm

Dependencies

None.

Example Playbook

- hosts: rpi

  vars:
    pip_package: python3-pip

  roles:
    - geerlingguy.pip
    - geerlingguy.docker_arm

License

MIT / BSD

Author Information

This role was created in 2019 by Jeff Geerling, author of Ansible for DevOps.

ansible-role-docker_arm's People

Contributors

callmeconnor avatar fernandopasik avatar geerlingguy avatar guz4217 avatar hassiweb avatar jtcmedia avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

ansible-role-docker_arm's Issues

Raspberry Pi OS - No package matching 'docker-ce' is available

I flashed a fresh copy of Raspberry Pi OS (2020-05-27-raspios-buster-lite-armhf.img) to the micro SD card then booted it in a Raspberry Pi 3B+. I enabled SSH and ran the following commands to prep it for Ansible:

pi@homeassistant-hub:~ $ cat .bash_history
sudo raspi-config
sudo apt-get update
sudo visudo
sudo apt-get upgrade
sudo reboot

My playbook is as follows:

---
- hosts: homeassistant_hub
  become: yes
  gather_facts: True
  vars:
    pip_package: python3-pip
    docker_install_compose: true
    docker_install_recommends: true
    docker_users:
      - pi

  roles:
    - geerlingguy.pip
    - geerlingguy.docker

This is the result of the playbook running:

➜  fort-edlin git:(master) ✗ ansible-galaxy list
# /Users/bi66pje/.ansible/roles
- geerlingguy.docker_arm, 4.0.0
- geerlingguy.docker, 2.8.1
- geerlingguy.nginx, 2.7.0
- geerlingguy.pip, 1.3.0
[WARNING]: - the configured path /usr/share/ansible/roles does not exist.
[WARNING]: - the configured path /etc/ansible/roles does not exist.
➜  fort-edlin git:(master) ✗ ansible-playbook homeassistant_hub.yaml
 __________________________
< PLAY [homeassistant_hub] >
 --------------------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||

 ________________________
< TASK [Gathering Facts] >
 ------------------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||

[WARNING]: Platform linux on host 192.168.10.24 is using the discovered Python interpreter at /usr/bin/python, but future installation of another
Python interpreter could change this. See https://docs.ansible.com/ansible/2.9/reference_appendices/interpreter_discovery.html for more information.
ok: [192.168.10.24]
 ___________________________________________________
< TASK [geerlingguy.pip : Ensure Pip is installed.] >
 ---------------------------------------------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||

[WARNING]: Updating cache and auto-installing missing dependency: python-apt
changed: [192.168.10.24]
 _________________________________________________________
/ TASK [geerlingguy.pip : Ensure pip_install_packages are \
\ installed.]                                             /
 ---------------------------------------------------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||

 ___________________________________________
< TASK [geerlingguy.docker : include_tasks] >
 -------------------------------------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||

skipping: [192.168.10.24]
 ___________________________________________
< TASK [geerlingguy.docker : include_tasks] >
 -------------------------------------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||

included: /Users/bi66pje/.ansible/roles/geerlingguy.docker/tasks/setup-Debian.yml for 192.168.10.24
 __________________________________________________________
/ TASK [geerlingguy.docker : Ensure old versions of Docker \
\ are not installed.]                                      /
 ----------------------------------------------------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||

ok: [192.168.10.24]
 ____________________________________________________
/ TASK [geerlingguy.docker : Ensure dependencies are \
\ installed.]                                        /
 ----------------------------------------------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||

changed: [192.168.10.24]
 _________________________________________________
< TASK [geerlingguy.docker : Add Docker apt key.] >
 -------------------------------------------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||

changed: [192.168.10.24]
 _____________________________________________________________
/ TASK [geerlingguy.docker : Ensure curl is present (on older \
\ systems without SNI).]                                      /
 -------------------------------------------------------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||

skipping: [192.168.10.24]
 ____________________________________________________________
/ TASK [geerlingguy.docker : Add Docker apt key (alternative \
\ for older systems without SNI).]                           /
 ------------------------------------------------------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||

skipping: [192.168.10.24]
 ____________________________________________________
< TASK [geerlingguy.docker : Add Docker repository.] >
 ----------------------------------------------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||

changed: [192.168.10.24]
 _____________________________________________
< TASK [geerlingguy.docker : Install Docker.] >
 ---------------------------------------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||

fatal: [192.168.10.24]: FAILED! => {"changed": false, "msg": "No package matching 'docker-ce' is available"}
 ____________
< PLAY RECAP >
 ------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||

192.168.10.24              : ok=7    changed=4    unreachable=0    failed=1    skipped=4    rescued=0    ignored=0

Seems the newest version of docker-compose can not be installed via pip

Not an issue with this repo per se, but the playbook fails to install docker-compose via pip. See this thread: docker/compose#6617

$ pip install docker-compose                                                                                                                                                                     
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting docker-compose
  Downloading https://files.pythonhosted.org/packages/f8/fa/94a68c7fb1292a726e95be53c8a66a85370de74b5d68adf7fcef61e6c7c9/docker_compose-1.25.3-py2.py3-none-any.whl (136kB)
    100% |################################| 143kB 1.8MB/s
Requirement already satisfied: backports.ssl-match-hostname<4,>=3.5; python_version < "3.5" in /usr/local/lib/python2.7/dist-packages (from docker-compose) (3.7.0.1)
Requirement already satisfied: six<2,>=1.3.0 in /usr/lib/python2.7/dist-packages (from docker-compose) (1.12.0)
Collecting docopt<1,>=0.6.1 (from docker-compose)
  Downloading https://www.piwheels.org/simple/docopt/docopt-0.6.2-py2.py3-none-any.whl
Collecting dockerpty<1,>=0.4.1 (from docker-compose)
  Downloading https://files.pythonhosted.org/packages/8d/ee/e9ecce4c32204a6738e0a5d5883d3413794d7498fe8b06f44becc028d3ba/dockerpty-0.4.1.tar.gz
Requirement already satisfied: docker[ssh]<5,>=3.7.0 in /usr/local/lib/python2.7/dist-packages (from docker-compose) (4.1.0)
Requirement already satisfied: requests<3,>=2.20.0 in /usr/local/lib/python2.7/dist-packages (from docker-compose) (2.22.0)
Collecting texttable<2,>=0.9.0 (from docker-compose)
  Downloading https://files.pythonhosted.org/packages/ec/b1/8a1c659ce288bf771d5b1c7cae318ada466f73bd0e16df8d86f27a2a3ee7/texttable-1.6.2-py2.py3-none-any.whl
Collecting subprocess32<4,>=3.5.4; python_version < "3.2" (from docker-compose)
  Downloading https://files.pythonhosted.org/packages/32/c8/564be4d12629b912ea431f1a50eb8b3b9d00f1a0b1ceff17f266be190007/subprocess32-3.5.4.tar.gz (97kB)
    100% |################################| 102kB 2.9MB/s
Collecting cached-property<2,>=1.2.0 (from docker-compose)
  Downloading https://files.pythonhosted.org/packages/3b/86/85c1be2e8db9e13ef9a350aecd6dea292bd612fa288c2f40d035bb750ded/cached_property-1.5.1-py2.py3-none-any.whl
Collecting PyYAML<6,>=3.10 (from docker-compose)
  Downloading https://files.pythonhosted.org/packages/3d/d9/ea9816aea31beeadccd03f1f8b625ecf8f645bd66744484d162d84803ce5/PyYAML-5.3.tar.gz (268kB)
    100% |################################| 276kB 1.3MB/s
Requirement already satisfied: websocket-client<1,>=0.32.0 in /usr/local/lib/python2.7/dist-packages (from docker-compose) (0.57.0)
Requirement already satisfied: enum34<2,>=1.0.4; python_version < "3.4" in /usr/lib/python2.7/dist-packages (from docker-compose) (1.1.6)
Requirement already satisfied: ipaddress<2,>=1.0.16; python_version < "3.3" in /usr/lib/python2.7/dist-packages (from docker-compose) (1.0.17)
Collecting jsonschema<4,>=2.5.1 (from docker-compose)
  Downloading https://files.pythonhosted.org/packages/c5/8f/51e89ce52a085483359217bc72cdbf6e75ee595d5b1d4b5ade40c7e018b8/jsonschema-3.2.0-py2.py3-none-any.whl (56kB)
    100% |################################| 61kB 2.4MB/s
Collecting backports.shutil-get-terminal-size==1.0.0; python_version < "3.3" (from docker-compose)
  Downloading https://files.pythonhosted.org/packages/7d/cd/1750d6c35fe86d35f8562091737907f234b78fdffab42b29c72b1dd861f4/backports.shutil_get_terminal_size-1.0.0-py2.py3-none-any.whl
Collecting paramiko>=2.4.2; extra == "ssh" (from docker[ssh]<5,>=3.7.0->docker-compose)
  Downloading https://files.pythonhosted.org/packages/06/1e/1e08baaaf6c3d3df1459fd85f0e7d2d6aa916f33958f151ee1ecc9800971/paramiko-2.7.1-py2.py3-none-any.whl (206kB)
    100% |################################| 215kB 1.7MB/s
Requirement already satisfied: idna<2.9,>=2.5 in /usr/local/lib/python2.7/dist-packages (from requests<3,>=2.20.0->docker-compose) (2.8)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /usr/local/lib/python2.7/dist-packages (from requests<3,>=2.20.0->docker-compose) (3.0.4)
Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python2.7/dist-packages (from requests<3,>=2.20.0->docker-compose) (2019.11.28)
Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /usr/local/lib/python2.7/dist-packages (from requests<3,>=2.20.0->docker-compose) (1.25.8)
Requirement already satisfied: setuptools in /usr/lib/python2.7/dist-packages (from jsonschema<4,>=2.5.1->docker-compose) (40.8.0)
Collecting attrs>=17.4.0 (from jsonschema<4,>=2.5.1->docker-compose)
  Downloading https://files.pythonhosted.org/packages/a2/db/4313ab3be961f7a763066401fb77f7748373b6094076ae2bda2806988af6/attrs-19.3.0-py2.py3-none-any.whl
Collecting importlib-metadata; python_version < "3.8" (from jsonschema<4,>=2.5.1->docker-compose)
  Downloading https://files.pythonhosted.org/packages/d7/31/74dcb59a601b95fce3b0334e8fc9db758f78e43075f22aeb3677dfb19f4c/importlib_metadata-1.4.0-py2.py3-none-any.whl
Collecting pyrsistent>=0.14.0 (from jsonschema<4,>=2.5.1->docker-compose)
  Downloading https://files.pythonhosted.org/packages/90/aa/cdcf7ef88cc0f831b6f14c8c57318824c9de9913fe8de38e46a98c069a35/pyrsistent-0.15.7.tar.gz (107kB)
    100% |################################| 112kB 2.9MB/s
Collecting functools32; python_version < "3" (from jsonschema<4,>=2.5.1->docker-compose)
  Downloading https://files.pythonhosted.org/packages/c5/60/6ac26ad05857c601308d8fb9e87fa36d0ebf889423f47c3502ef034365db/functools32-3.2.3-2.tar.gz
Collecting bcrypt>=3.1.3 (from paramiko>=2.4.2; extra == "ssh"->docker[ssh]<5,>=3.7.0->docker-compose)
  Downloading https://files.pythonhosted.org/packages/fa/aa/025a3ab62469b5167bc397837c9ffc486c42a97ef12ceaa6699d8f5a5416/bcrypt-3.1.7.tar.gz (42kB)
    100% |################################| 51kB 3.5MB/s
  Installing build dependencies ... error
  Complete output from command /usr/bin/python -m pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-kGJqHF --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple --extra-index-url https://www.piwheels.org/simple -- setuptools>=40.8.0 wheel "cffi>=1.1; python_implementation != 'PyPy'":
  Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple, https://www.piwheels.org/simple
  Collecting setuptools>=40.8.0
    Downloading https://files.pythonhosted.org/packages/f9/d3/955738b20d3832dfa3cd3d9b07e29a8162edb480bf988332f5e6e48ca444/setuptools-44.0.0-py2.py3-none-any.whl (583kB)
  Collecting wheel
    Downloading https://files.pythonhosted.org/packages/00/83/b4a77d044e78ad1a45610eb88f745be2fd2c6d658f9798a15e384b7d57c9/wheel-0.33.6-py2.py3-none-any.whl
  Collecting cffi>=1.1
    Downloading https://files.pythonhosted.org/packages/2d/bf/960e5a422db3ac1a5e612cb35ca436c3fc985ed4b7ed13a1b4879006f450/cffi-1.13.2.tar.gz (460kB)
  Collecting pycparser (from cffi>=1.1)
    Downloading https://www.piwheels.org/simple/pycparser/pycparser-2.19-py2.py3-none-any.whl (111kB)
  Building wheels for collected packages: cffi
    Running setup.py bdist_wheel for cffi: started
    Running setup.py bdist_wheel for cffi: finished with status 'error'
    Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-nZ1y7L/cffi/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/pip-wheel-i_cv6F --python-tag cp27:
    Package libffi was not found in the pkg-config search path.
    Perhaps you should add the directory containing `libffi.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'libffi' found
    Package libffi was not found in the pkg-config search path.
    Perhaps you should add the directory containing `libffi.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'libffi' found
    Package libffi was not found in the pkg-config search path.
    Perhaps you should add the directory containing `libffi.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'libffi' found
    Package libffi was not found in the pkg-config search path.
    Perhaps you should add the directory containing `libffi.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'libffi' found
    Package libffi was not found in the pkg-config search path.
    Perhaps you should add the directory containing `libffi.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'libffi' found
    running bdist_wheel
    running build
    running build_py
    creating build
    creating build/lib.linux-armv7l-2.7
    creating build/lib.linux-armv7l-2.7/cffi
    copying cffi/commontypes.py -> build/lib.linux-armv7l-2.7/cffi
    copying cffi/pkgconfig.py -> build/lib.linux-armv7l-2.7/cffi
    copying cffi/api.py -> build/lib.linux-armv7l-2.7/cffi
    copying cffi/ffiplatform.py -> build/lib.linux-armv7l-2.7/cffi
    copying cffi/recompiler.py -> build/lib.linux-armv7l-2.7/cffi
    copying cffi/setuptools_ext.py -> build/lib.linux-armv7l-2.7/cffi
    copying cffi/model.py -> build/lib.linux-armv7l-2.7/cffi
    copying cffi/vengine_gen.py -> build/lib.linux-armv7l-2.7/cffi
    copying cffi/vengine_cpy.py -> build/lib.linux-armv7l-2.7/cffi
    copying cffi/backend_ctypes.py -> build/lib.linux-armv7l-2.7/cffi
    copying cffi/__init__.py -> build/lib.linux-armv7l-2.7/cffi
    copying cffi/lock.py -> build/lib.linux-armv7l-2.7/cffi
    copying cffi/verifier.py -> build/lib.linux-armv7l-2.7/cffi
    copying cffi/cparser.py -> build/lib.linux-armv7l-2.7/cffi
    copying cffi/error.py -> build/lib.linux-armv7l-2.7/cffi
    copying cffi/cffi_opcode.py -> build/lib.linux-armv7l-2.7/cffi
    copying cffi/_cffi_include.h -> build/lib.linux-armv7l-2.7/cffi
    copying cffi/parse_c_type.h -> build/lib.linux-armv7l-2.7/cffi
    copying cffi/_embedding.h -> build/lib.linux-armv7l-2.7/cffi
    copying cffi/_cffi_errors.h -> build/lib.linux-armv7l-2.7/cffi
    running build_ext
    building '_cffi_backend' extension
    creating build/temp.linux-armv7l-2.7
    creating build/temp.linux-armv7l-2.7/c
    arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-InigCj/python2.7-2.7.16=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DUSE__THREAD -DHAVE_SYNC_SYNCHRONIZE -I/usr/include/ffi -I/usr/include/libffi -I/usr/include/python2.7 -c c/_cffi_backend.c -o build/temp.linux-armv7l-2.7/c/_cffi_backend.o
    c/_cffi_backend.c:15:10: fatal error: ffi.h: No such file or directory
     #include <ffi.h>
              ^~~~~~~
    compilation terminated.
    error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1

    ----------------------------------------
    Failed building wheel for cffi
    Running setup.py clean for cffi
  Failed to build cffi
  Installing collected packages: setuptools, wheel, pycparser, cffi
    Running setup.py install for cffi: started
      Running setup.py install for cffi: finished with status 'error'
      Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-nZ1y7L/cffi/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-aV4iLJ/install-record.txt --single-version-externally-managed --prefix /tmp/pip-build-env-kGJqHF --compile:
      Package libffi was not found in the pkg-config search path.
      Perhaps you should add the directory containing `libffi.pc'
      to the PKG_CONFIG_PATH environment variable
      No package 'libffi' found
      Package libffi was not found in the pkg-config search path.
      Perhaps you should add the directory containing `libffi.pc'
      to the PKG_CONFIG_PATH environment variable
      No package 'libffi' found
      Package libffi was not found in the pkg-config search path.
      Perhaps you should add the directory containing `libffi.pc'
      to the PKG_CONFIG_PATH environment variable
      No package 'libffi' found
      Package libffi was not found in the pkg-config search path.
      Perhaps you should add the directory containing `libffi.pc'
      to the PKG_CONFIG_PATH environment variable
      No package 'libffi' found
      Package libffi was not found in the pkg-config search path.
      Perhaps you should add the directory containing `libffi.pc'
      to the PKG_CONFIG_PATH environment variable
      No package 'libffi' found
      running install
      running build
      running build_py
      creating build
      creating build/lib.linux-armv7l-2.7
      creating build/lib.linux-armv7l-2.7/cffi
      copying cffi/commontypes.py -> build/lib.linux-armv7l-2.7/cffi
      copying cffi/pkgconfig.py -> build/lib.linux-armv7l-2.7/cffi
      copying cffi/api.py -> build/lib.linux-armv7l-2.7/cffi
      copying cffi/ffiplatform.py -> build/lib.linux-armv7l-2.7/cffi
      copying cffi/recompiler.py -> build/lib.linux-armv7l-2.7/cffi
      copying cffi/setuptools_ext.py -> build/lib.linux-armv7l-2.7/cffi
      copying cffi/model.py -> build/lib.linux-armv7l-2.7/cffi
      copying cffi/vengine_gen.py -> build/lib.linux-armv7l-2.7/cffi
      copying cffi/vengine_cpy.py -> build/lib.linux-armv7l-2.7/cffi
      copying cffi/backend_ctypes.py -> build/lib.linux-armv7l-2.7/cffi
      copying cffi/__init__.py -> build/lib.linux-armv7l-2.7/cffi
      copying cffi/lock.py -> build/lib.linux-armv7l-2.7/cffi
      copying cffi/verifier.py -> build/lib.linux-armv7l-2.7/cffi
      copying cffi/cparser.py -> build/lib.linux-armv7l-2.7/cffi
      copying cffi/error.py -> build/lib.linux-armv7l-2.7/cffi
      copying cffi/cffi_opcode.py -> build/lib.linux-armv7l-2.7/cffi
      copying cffi/_cffi_include.h -> build/lib.linux-armv7l-2.7/cffi
      copying cffi/parse_c_type.h -> build/lib.linux-armv7l-2.7/cffi
      copying cffi/_embedding.h -> build/lib.linux-armv7l-2.7/cffi
      copying cffi/_cffi_errors.h -> build/lib.linux-armv7l-2.7/cffi
      running build_ext
      building '_cffi_backend' extension
      creating build/temp.linux-armv7l-2.7
      creating build/temp.linux-armv7l-2.7/c
      arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-InigCj/python2.7-2.7.16=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DUSE__THREAD -DHAVE_SYNC_SYNCHRONIZE -I/usr/include/ffi -I/usr/include/libffi -I/usr/include/python2.7 -c c/_cffi_backend.c -o build/temp.linux-armv7l-2.7/c/_cffi_backend.o
      c/_cffi_backend.c:15:10: fatal error: ffi.h: No such file or directory
       #include <ffi.h>
                ^~~~~~~
      compilation terminated.
      error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1

      ----------------------------------------
  Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-nZ1y7L/cffi/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-aV4iLJ/install-record.txt --single-version-externally-managed --prefix /tmp/pip-build-env-kGJqHF --compile" failed with error code 1 in /tmp/pip-install-nZ1y7L/cffi/

  ----------------------------------------
Command "/usr/bin/python -m pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-kGJqHF --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple --extra-index-url https://www.piwheels.org/simple -- setuptools>=40.8.0 wheel "cffi>=1.1; python_implementation != 'PyPy'"" failed with error code 1 in None

I believe you need to pin the version or add it as a variable to the role

Dryrun failing because of missing check_mode: no option in validation task

Hi, just "--check"runned a tiny installation playbook calling your and noticed an error right at the 1nd task preventing successfull execution.

Expected behaviour:

ansible-playbook docker_install.yml --check
 [WARNING]: provided hosts list is empty, only localhost is available [...]

PLAY [Docker playbook] **************************************************************************
TASK [Gathering Facts] **************************************************************************
ok: [localhost]

TASK [geerlingguy.docker_arm : Check if Docker is already present.] *****************************
skipping: [localhost]
[...]

Actual behaviour:

ansible-playbook docker_install.yml --check
[WARNING]: provided hosts list is empty, only localhost is available [...]
 
PLAY [Docker playbook] **************************************************************************
TASK [Gathering Facts] **************************************************************************
ok: [localhost]

TASK [geerlingguy.docker_arm : Download Docker install convenience script.] *********************
fatal: [localhost]: 
FAILED! => {"msg": "The conditional check 'docker_command_result.rc == 1' failed. The error was: error while evaluating conditional (docker_command_result.rc == 1): 'dict object' has no attribute 'rc'\n\nThe error appears to have been in '/home/pi/.ansible/roles/geerlingguy.docker_arm/tasks/main.yml': line 8, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: Download Docker install convenience script.\n  ^ here\n"}
        to retry, use: --limit @/home/pi/docker_install.retry

PLAY RECAP **************************************************************************************
localhost                  : ok=1    changed=0    unreachable=0    failed=1

I'm quite familiar with this behaviour, that commands, in this case in the Task: "geerlingguy.docker_arm : Check if Docker is already present." is skipped in a check run. AFAIK the command "which docker" is still the most convenient way to go here, in case a simple validation task is done.

So, as in many other occasions I simply added the option
"check_mode: no"
to the task wich produces the expected dryrun behaviour which now works like a charm :) . Would you like to add that here also? Hope I get githubs PR workflow figured out quickly, will add this then ;)

Version check fails for bullseye as defaults are set to buster

In main.yml

  • name: Make sure Docker CE is the version specified.

But the defaults are set to Buster
This works:
docker_version_armv6: "5:20.10.03-0raspbian-{{ansible_distribution_release}}"
docker_version_armv7: "5:20.10.103-0raspbian-{{ansible_distribution_release}}"
docker_version_arm64: "5:20.10.103-0debian-{{ansible_distribution_release}}"

Sorry, don't know how to do a PR and wanted you opinion on whether this was a good way to solve it/ I may be misunderstanding the problem

Also, is there some way to just install the latest version, rather than specifying the exact version?

Installation failed on current Raspi OS (Debian 10.10)

I'm completely new to Ansible so please point me to the right direction if I messed up.
Clean Raspi OS install

root@raspi02:/opt/docker/_ansible# ansible-playbook raspi_docker.yml

PLAY [raspi docker install] **********************************************************************************************************************************************************************************************************

TASK [Gathering Facts] ***************************************************************************************************************************************************************************************************************
ok: [raspi03.corp.xxx.abc]

TASK [geerlingguy.pip : Ensure Pip is installed.] ************************************************************************************************************************************************************************************
^[[A^[[Bchanged: [raspi03.corp.xxx.abc]

TASK [geerlingguy.pip : Ensure pip_install_packages are installed.] ******************************************************************************************************************************************************************
changed: [raspi03.corp.xxx.abc] => (item={'name': 'docker'})

TASK [geerlingguy.docker_arm : Check if Docker is already present.] ******************************************************************************************************************************************************************
ok: [raspi03.corp.xxx.abc]

TASK [geerlingguy.docker_arm : Download Docker install convenience script.] **********************************************************************************************************************************************************
changed: [raspi03.corp.xxx.abc]

TASK [geerlingguy.docker_arm : Run Docker install convenience script.] ***************************************************************************************************************************************************************
fatal: [raspi03.corp.xxx.abc]: FAILED! => {"changed": true, "cmd": ["/tmp/get-docker.sh"], "delta": "0:01:20.804713", "end": "2021-07-30 16:16:53.132732", "msg": "non-zero return code", "rc": 100, "start": "2021-07-30 16:15:32.328019", "stderr": "+ sh -c apt-get update -qq >/dev/null\n+ sh -c DEBIAN_FRONTEND=noninteractive apt-get install -y -qq apt-transport-https ca-certificates curl >/dev/null\n+ sh -c curl -fsSL \"https://download.docker.com/linux/raspbian/gpg\" | apt-key add -qq - >/dev/null\nWarning: apt-key output should not be parsed (stdout is not a terminal)\n+ sh -c echo \"deb [arch=armhf] https://download.docker.com/linux/raspbian buster stable\" > /etc/apt/sources.list.d/docker.list\n+ sh -c apt-get update -qq >/dev/null\n+ [ -n  ]\n+ sh -c apt-get install -y -qq --no-install-recommends docker-ce >/dev/null\nE: Sub-process /usr/bin/dpkg returned an error code (1)", "stderr_lines": ["+ sh -c apt-get update -qq >/dev/null", "+ sh -c DEBIAN_FRONTEND=noninteractive apt-get install -y -qq apt-transport-https ca-certificates curl >/dev/null", "+ sh -c curl -fsSL \"https://download.docker.com/linux/raspbian/gpg\" | apt-key add -qq - >/dev/null", "Warning: apt-key output should not be parsed (stdout is not a terminal)", "+ sh -c echo \"deb [arch=armhf] https://download.docker.com/linux/raspbian buster stable\" > /etc/apt/sources.list.d/docker.list", "+ sh -c apt-get update -qq >/dev/null", "+ [ -n  ]", "+ sh -c apt-get install -y -qq --no-install-recommends docker-ce >/dev/null", "E: Sub-process /usr/bin/dpkg returned an error code (1)"], "stdout": "# Executing docker install script, commit: 7cae5f8b0decc17d6571f9f52eb840fbc13b2737", "stdout_lines": ["# Executing docker install script, commit: 7cae5f8b0decc17d6571f9f52eb840fbc13b2737"]}
        to retry, use: --limit @/opt/docker/_ansible/raspi_docker.retry

PLAY RECAP ***************************************************************************************************************************************************************************************************************************
raspi03.corp.xxx.abc      : ok=5    changed=3    unreachable=0    failed=1

root@raspi02:/opt/docker/_ansible# ansible-playbook raspi_docker.yml

PLAY [raspi docker install] **********************************************************************************************************************************************************************************************************

TASK [Gathering Facts] ***************************************************************************************************************************************************************************************************************
ok: [raspi03.corp.xxx.abc]

TASK [geerlingguy.pip : Ensure Pip is installed.] ************************************************************************************************************************************************************************************
ok: [raspi03.corp.xxx.abc]

TASK [geerlingguy.pip : Ensure pip_install_packages are installed.] ******************************************************************************************************************************************************************
ok: [raspi03.corp.xxx.abc] => (item={'name': 'docker'})

TASK [geerlingguy.docker_arm : Check if Docker is already present.] ******************************************************************************************************************************************************************
ok: [raspi03.corp.xxx.abc]

TASK [geerlingguy.docker_arm : Download Docker install convenience script.] **********************************************************************************************************************************************************
skipping: [raspi03.corp.xxx.abc]

TASK [geerlingguy.docker_arm : Run Docker install convenience script.] ***************************************************************************************************************************************************************
skipping: [raspi03.corp.xxx.abc]

TASK [geerlingguy.docker_arm : Make sure Docker CE is the version specified.] ********************************************************************************************************************************************************
fatal: [raspi03.corp.xxx.abc]: FAILED! => {"cache_update_time": 1627654543, "cache_updated": false, "changed": false, "msg": "'/usr/bin/apt-get -y -o \"Dpkg::Options::=--force-confdef\" -o \"Dpkg::Options::=--force-confold\"  --force-yes   install 'docker-ce=5:19.03.12~3-0~raspbian-buster' -o APT::Install-Recommends=no' failed: W: --force-yes is deprecated, use one of the options starting with --allow instead.\nE: Sub-process /usr/bin/dpkg returned an error code (1)\n", "rc": 100, "stderr": "W: --force-yes is deprecated, use one of the options starting with --allow instead.\nE: Sub-process /usr/bin/dpkg returned an error code (1)\n", "stderr_lines": ["W: --force-yes is deprecated, use one of the options starting with --allow instead.", "E: Sub-process /usr/bin/dpkg returned an error code (1)"], "stdout": "Reading package lists...\nBuilding dependency tree...\nReading state information...\nRecommended packages:\n  cgroupfs-mount | cgroup-lite libltdl7\nThe following packages will be DOWNGRADED:\n  docker-ce\n0 upgraded, 0 newly installed, 1 downgraded, 0 to remove and 0 not upgraded.\n1 not fully installed or removed.\nNeed to get 14.4 MB of archives.\nAfter this operation, 8739 kB disk space will be freed.\nGet:1 https://download.docker.com/linux/raspbian buster/stable armhf docker-ce armhf 5:19.03.12~3-0~raspbian-buster [14.4 MB]\nFetched 14.4 MB in 15s (953 kB/s)\ndpkg: warning: downgrading docker-ce from 5:20.10.7~3-0~raspbian-buster to 5:19.03.12~3-0~raspbian-buster\r\n(Reading database ... \r(Reading database ... 5%\r(Reading database ... 10%\r(Reading database ... 15%\r(Reading database ... 20%\r(Reading database ... 25%\r(Reading database ... 30%\r(Reading database ... 35%\r(Reading database ... 40%\r(Reading database ... 45%\r(Reading database ... 50%\r(Reading database ... 55%\r(Reading database ... 60%\r(Reading database ... 65%\r(Reading database ... 70%\r(Reading database ... 75%\r(Reading database ... 80%\r(Reading database ... 85%\r(Reading database ... 90%\r(Reading database ... 95%\r(Reading database ... 100%\r(Reading database ... 43339 files and directories currently installed.)\r\nPreparing to unpack .../docker-ce_5%3a19.03.12~3-0~raspbian-buster_armhf.deb ...\r\nUnpacking docker-ce (5:19.03.12~3-0~raspbian-buster) over (5:20.10.7~3-0~raspbian-buster) ...\r\nSetting up docker-ce (5:19.03.12~3-0~raspbian-buster) ...\r\nJob for docker.service failed because the control process exited with error code.\r\nSee \"systemctl status docker.service\" and \"journalctl -xe\" for details.\r\ninvoke-rc.d: initscript docker, action \"start\" failed.\r\n* docker.service - Docker Application Container Engine\r\n   Loaded: loaded (\u001b]8;;file://raspi03/lib/systemd/system/docker.service\u0007/lib/systemd/system/docker.service\u001b]8;;\u0007; enabled; vendor preset: enabled)\r\n   Active: activating (auto-restart) (Result: exit-code) since Fri 2021-07-30 16:17:49 CEST; 20ms ago\r\n     Docs: \u001b]8;;https://docs.docker.com\u0007https://docs.docker.com\u001b]8;;\u0007\r\n  Process: 14420 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock \u001b[0;1;31m(code=exited, status=1/FAILURE)\u001b[0m\r\n Main PID: 14420 (code=exited, status=1/FAILURE)\r\ndpkg: error processing package docker-ce (--configure):\r\n installed docker-ce package post-installation script subprocess returned error exit status 1\r\nProcessing triggers for systemd (241-7~deb10u7+rpi1) ...\r\nErrors were encountered while processing:\r\n docker-ce\r\n", "stdout_lines": ["Reading package lists...", "Building dependency tree...", "Reading state information...", "Recommended packages:", "  cgroupfs-mount | cgroup-lite libltdl7", "The following packages will be DOWNGRADED:", "  docker-ce", "0 upgraded, 0 newly installed, 1 downgraded, 0 to remove and 0 not upgraded.", "1 not fully installed or removed.", "Need to get 14.4 MB of archives.", "After this operation, 8739 kB disk space will be freed.", "Get:1 https://download.docker.com/linux/raspbian buster/stable armhf docker-ce armhf 5:19.03.12~3-0~raspbian-buster [14.4 MB]", "Fetched 14.4 MB in 15s (953 kB/s)", "dpkg: warning: downgrading docker-ce from 5:20.10.7~3-0~raspbian-buster to 5:19.03.12~3-0~raspbian-buster", "(Reading database ... ", "(Reading database ... 5%", "(Reading database ... 10%", "(Reading database ... 15%", "(Reading database ... 20%", "(Reading database ... 25%", "(Reading database ... 30%", "(Reading database ... 35%", "(Reading database ... 40%", "(Reading database ... 45%", "(Reading database ... 50%", "(Reading database ... 55%", "(Reading database ... 60%", "(Reading database ... 65%", "(Reading database ... 70%", "(Reading database ... 75%", "(Reading database ... 80%", "(Reading database ... 85%", "(Reading database ... 90%", "(Reading database ... 95%", "(Reading database ... 100%", "(Reading database ... 43339 files and directories currently installed.)", "Preparing to unpack .../docker-ce_5%3a19.03.12~3-0~raspbian-buster_armhf.deb ...", "Unpacking docker-ce (5:19.03.12~3-0~raspbian-buster) over (5:20.10.7~3-0~raspbian-buster) ...", "Setting up docker-ce (5:19.03.12~3-0~raspbian-buster) ...", "Job for docker.service failed because the control process exited with error code.", "See \"systemctl status docker.service\" and \"journalctl -xe\" for details.", "invoke-rc.d: initscript docker, action \"start\" failed.", "* docker.service - Docker Application Container Engine", "   Loaded: loaded (\u001b]8;;file://raspi03/lib/systemd/system/docker.service\u0007/lib/systemd/system/docker.service\u001b]8;;\u0007; enabled; vendor preset: enabled)", "   Active: activating (auto-restart) (Result: exit-code) since Fri 2021-07-30 16:17:49 CEST; 20ms ago", "     Docs: \u001b]8;;https://docs.docker.com\u0007https://docs.docker.com\u001b]8;;\u0007", "  Process: 14420 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock \u001b[0;1;31m(code=exited, status=1/FAILURE)\u001b[0m", " Main PID: 14420 (code=exited, status=1/FAILURE)", "dpkg: error processing package docker-ce (--configure):", " installed docker-ce package post-installation script subprocess returned error exit status 1", "Processing triggers for systemd (241-7~deb10u7+rpi1) ...", "Errors were encountered while processing:", " docker-ce"]}
        to retry, use: --limit @/opt/docker/_ansible/raspi_docker.retry

PLAY RECAP ***************************************************************************************************************************************************************************************************************************
raspi03.corp.xxx.abc      : ok=4    changed=0    unreachable=0    failed=1

root@raspi02:/opt/docker/_ansible# ansible-playbook raspi_docker.yml

PLAY [raspi docker install] **********************************************************************************************************************************************************************************************************

TASK [Gathering Facts] ***************************************************************************************************************************************************************************************************************
ok: [raspi03.corp.xxx.abc]

TASK [geerlingguy.pip : Ensure Pip is installed.] ************************************************************************************************************************************************************************************
ok: [raspi03.corp.xxx.abc]

TASK [geerlingguy.pip : Ensure pip_install_packages are installed.] ******************************************************************************************************************************************************************
ok: [raspi03.corp.xxx.abc] => (item={'name': 'docker'})

TASK [geerlingguy.docker_arm : Check if Docker is already present.] ******************************************************************************************************************************************************************
ok: [raspi03.corp.xxx.abc]

TASK [geerlingguy.docker_arm : Download Docker install convenience script.] **********************************************************************************************************************************************************
skipping: [raspi03.corp.xxx.abc]

TASK [geerlingguy.docker_arm : Run Docker install convenience script.] ***************************************************************************************************************************************************************
skipping: [raspi03.corp.xxx.abc]

TASK [geerlingguy.docker_arm : Make sure Docker CE is the version specified.] ********************************************************************************************************************************************************
fatal: [raspi03.corp.xxx.abc]: FAILED! => {"cache_update_time": 1627654543, "cache_updated": false, "changed": false, "msg": "'/usr/bin/apt-get -y -o \"Dpkg::Options::=--force-confdef\" -o \"Dpkg::Options::=--force-confold\"  --force-yes   install 'docker-ce=5:19.03.12~3-0~raspbian-buster' -o APT::Install-Recommends=no' failed: W: --force-yes is deprecated, use one of the options starting with --allow instead.\nE: Sub-process /usr/bin/dpkg returned an error code (1)\n", "rc": 100, "stderr": "W: --force-yes is deprecated, use one of the options starting with --allow instead.\nE: Sub-process /usr/bin/dpkg returned an error code (1)\n", "stderr_lines": ["W: --force-yes is deprecated, use one of the options starting with --allow instead.", "E: Sub-process /usr/bin/dpkg returned an error code (1)"], "stdout": "Reading package lists...\nBuilding dependency tree...\nReading state information...\ndocker-ce is already the newest version (5:19.03.12~3-0~raspbian-buster).\n0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.\n1 not fully installed or removed.\nAfter this operation, 0 B of additional disk space will be used.\nSetting up docker-ce (5:19.03.12~3-0~raspbian-buster) ...\r\nJob for docker.service failed because the control process exited with error code.\r\nSee \"systemctl status docker.service\" and \"journalctl -xe\" for details.\r\ninvoke-rc.d: initscript docker, action \"start\" failed.\r\n* docker.service - Docker Application Container Engine\r\n   Loaded: loaded (\u001b]8;;file://raspi03/lib/systemd/system/docker.service\u0007/lib/systemd/system/docker.service\u001b]8;;\u0007; enabled; vendor preset: enabled)\r\n   Active: activating (auto-restart) (Result: exit-code) since Fri 2021-07-30 16:23:22 CEST; 20ms ago\r\n     Docs: \u001b]8;;https://docs.docker.com\u0007https://docs.docker.com\u001b]8;;\u0007\r\n  Process: 14972 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock \u001b[0;1;31m(code=exited, status=1/FAILURE)\u001b[0m\r\n Main PID: 14972 (code=exited, status=1/FAILURE)\r\ndpkg: error processing package docker-ce (--configure):\r\n installed docker-ce package post-installation script subprocess returned error exit status 1\r\nErrors were encountered while processing:\r\n docker-ce\r\n", "stdout_lines": ["Reading package lists...", "Building dependency tree...", "Reading state information...", "docker-ce is already the newest version (5:19.03.12~3-0~raspbian-buster).", "0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.", "1 not fully installed or removed.", "After this operation, 0 B of additional disk space will be used.", "Setting up docker-ce (5:19.03.12~3-0~raspbian-buster) ...", "Job for docker.service failed because the control process exited with error code.", "See \"systemctl status docker.service\" and \"journalctl -xe\" for details.", "invoke-rc.d: initscript docker, action \"start\" failed.", "* docker.service - Docker Application Container Engine", "   Loaded: loaded (\u001b]8;;file://raspi03/lib/systemd/system/docker.service\u0007/lib/systemd/system/docker.service\u001b]8;;\u0007; enabled; vendor preset: enabled)", "   Active: activating (auto-restart) (Result: exit-code) since Fri 2021-07-30 16:23:22 CEST; 20ms ago", "     Docs: \u001b]8;;https://docs.docker.com\u0007https://docs.docker.com\u001b]8;;\u0007", "  Process: 14972 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock \u001b[0;1;31m(code=exited, status=1/FAILURE)\u001b[0m", " Main PID: 14972 (code=exited, status=1/FAILURE)", "dpkg: error processing package docker-ce (--configure):", " installed docker-ce package post-installation script subprocess returned error exit status 1", "Errors were encountered while processing:", " docker-ce"]}
        to retry, use: --limit @/opt/docker/_ansible/raspi_docker.retry

PLAY RECAP ***************************************************************************************************************************************************************************************************************************
raspi03.corp.xxx.abc      : ok=4    changed=0    unreachable=0    failed=1

playbook:

---
- name: raspi docker install
  hosts: raspi03.corp.xxx.abc
  remote_user: pi
  become: yes
  ignore_unreachable: yes

  vars:
    pip_package: python3-pip
    pip_install_packages:
      - name: docker

  roles:
    - geerlingguy.pip
    - geerlingguy.docker_arm

The gpg keys on the get-docker.sh script dont work.

Error: fatal: [xxxxxxx]: FAILED! => {"changed": false, "msg": "E:Conflicting values set for option Signed-By regarding source https://download.docker.com/linux/ubuntu/ jammy: /etc/apt/keyrings/docker.gpg != , E:The list of sources could not be read."}

Fix: Had to remove "signed-by=/etc/apt/keyrings/docker.gpg" from the apt_repo variable to make it work.
Downloaded your role, made the updates to the script get-docker.sh script url and used the below changes to work with your ansible role.
apt_repo="deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] $DOWNLOAD_URL/linux/$lsb_dist $dist_version $CHANNEL"

- name: Copy script to remote host
  copy:
    src: /Users/xxxxx/Library/Mobile Documents/com~apple~CloudDocs/Desktop/day-to-day-files/My-K8s/k8s-init-playbook/scripts/get-docker.sh
    dest: /tmp/get-docker.sh
    mode: '0755'  # Set the appropriate permissions on the script

- name: Execute script on remote host
  command: /tmp/get-docker.sh

Would be nice to have this handled while you deprecate this role.

Docker install script relocated

Hi.

Docker install script has been relocated from

https://get.docker.com/tmp/get-docker.sh

to

https://get.docker.com/

Your script is broken without this modification.

'ERROR! no action detected in task.' when using 'docker_compose'

I'm trying to write a playbook that uses 'docker_compose' as an action in a task in my playbook, but it keeps telling me there is no action detected in the task. The same syntax in combination with your non ARM-docker role which works fine though.
Is there a different in syntax on how to use 'docker_compose' as an action in a task for the ARM-docker role compared to the non-ARM docker role?

Steps to reproduce:

Suppose I have the following playbook:

- hosts: adguard
  become: true
  vars:
    pip_package: python3-pip
    docker_install_compose: true
    docker_users:
      - adguard
  roles:
    - geerlingguy.pip
    - geerlingguy.docker_arm

- hosts: adguard
  become: true
  tasks:
  - name: Copy Docker Compose
    copy:
      src: docker-compose.yml
      dest: /opt/adguard/docker-compose.yml

  - name: Deploy Stack using Docker Compose
    docker_compose:
      project_src: /opt/adguard
      state: present

Alongside the following requirements file:

- src: geerlingguy.docker_arm
- src: geerlingguy.pip
- src: oefenweb.rc_local

Running ansible-galaxy install -r requirements.yml --force outputs:

- changing role geerlingguy.docker_arm from 4.0.0 to unspecified
- downloading role 'docker_arm', owned by geerlingguy
- downloading role from https://github.com/geerlingguy/ansible-role-docker_arm/archive/4.0.0.tar.gz
- extracting geerlingguy.docker_arm to /home/pirate/.ansible/roles/geerlingguy.docker_arm
- geerlingguy.docker_arm (4.0.0) was installed successfully
- downloading role 'pip', owned by geerlingguy
- downloading role from https://github.com/geerlingguy/ansible-role-pip/archive/2.0.0.tar.gz
- extracting geerlingguy.pip to /home/pirate/.ansible/roles/geerlingguy.pip
- geerlingguy.pip (2.0.0) was installed successfully
- changing role oefenweb.rc_local from v1.0.40 to unspecified
- downloading role 'rc_local', owned by oefenweb
- downloading role from https://github.com/Oefenweb/ansible-rc-local/archive/v1.0.40.tar.gz
- extracting oefenweb.rc_local to /home/pirate/.ansible/roles/oefenweb.rc_local
- oefenweb.rc_local (v1.0.40) was installed successfully

Afterwards, the playbook is run as follows: ansible-playbook playbook.yml --ask-become-pass -vvv
which gives the following output:

ansible-playbook 2.7.7
  config file = /home/pirate/ansible-adguard/ansible.cfg
  configured module search path = ['/home/pirate/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3/dist-packages/ansible
  executable location = /usr/bin/ansible-playbook
  python version = 3.7.3 (default, Jul 25 2020, 13:03:44) [GCC 8.3.0]
Using /home/pirate/ansible-adguard/ansible.cfg as config file
SUDO password:
/home/pirate/ansible-adguard/hosts did not meet host_list requirements, check plugin documentation if this is unexpected
/home/pirate/ansible-adguard/hosts did not meet script requirements, check plugin documentation if this is unexpected
Parsed /home/pirate/ansible-adguard/hosts inventory source with ini plugin
statically imported: /home/pirate/.ansible/roles/geerlingguy.docker_arm/tasks/docker-1809-shim.yml
ERROR! no action detected in task. This often indicates a misspelled module name, or incorrect module path.

The error appears to have been in '/home/pirate/ansible-adguard/playbook.yml': line 215, column 5, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:


  - name: Deploy Stack using Docker Compose
    ^ here

Additional debug information from the user that reported this to me:
Raspbian GNU/Linux 10 (buster)
Docker version 20.10.2, build 2291f61
docker-compose version 1.26.1, build 634eb50

Thank you!

Make role work on Raspbian 10 'Buster'

Right now because the Docker repos have no packages for buster, the following error is thrown on the latest releases of Raspbian:

TASK [geerlingguy.docker_arm : Run Docker install convenience script.] *************************************************
fatal: [kube1]: FAILED! => {"changed": true, "cmd": ["/tmp/get-docker.sh"], "delta": "0:00:06.923446", "end": "2019-07-08 02:17:41.858638", "msg": "non-zero return code", "rc": 100, "start": "2019-07-08 02:17:34.935192", "stderr": "+ sh -c apt-get update -qq >/dev/null\n+ sh -c apt-get install -y -qq apt-transport-https ca-certificates curl >/dev/null\ndebconf: delaying package configuration, since apt-utils is not installed\n+ sh -c curl -fsSL \"https://download.docker.com/linux/debian/gpg\" | apt-key add -qq - >/dev/null\nWarning: apt-key output should not be parsed (stdout is not a terminal)\n+ sh -c echo \"deb [arch=amd64] https://download.docker.com/linux/debian 10 stable\" > /etc/apt/sources.list.d/docker.list\n+ sh -c apt-get update -qq >/dev/null\nE: The repository 'https://download.docker.com/linux/debian 10 Release' does not have a Release file.", "stderr_lines": ["+ sh -c apt-get update -qq >/dev/null", "+ sh -c apt-get install -y -qq apt-transport-https ca-certificates curl >/dev/null", "debconf: delaying package configuration, since apt-utils is not installed", "+ sh -c curl -fsSL \"https://download.docker.com/linux/debian/gpg\" | apt-key add -qq - >/dev/null", "Warning: apt-key output should not be parsed (stdout is not a terminal)", "+ sh -c echo \"deb [arch=amd64] https://download.docker.com/linux/debian 10 stable\" > /etc/apt/sources.list.d/docker.list", "+ sh -c apt-get update -qq >/dev/null", "E: The repository 'https://download.docker.com/linux/debian 10 Release' does not have a Release file."], "stdout": "# Executing docker install script, commit: 2f4ae48", "stdout_lines": ["# Executing docker install script, commit: 2f4ae48"]}

See upstream issue: geerlingguy/raspberry-pi-dramble#156

Install Docker Compose using Pip failes thanks to outdated Rust version 1.48

I am setting up docker on my old Raspberry Pi 2 Model B Rev 1.1
OS: Raspbian GNU/Linux 11 (bullseye) armv7l
Kernel: 5.15.61-v7+
CPU: BCM2835 (4) @ 900MHz

The command pip install docker-compose failes due to an oudated Rust version (1.48) with the following build error:

  • version >=1.56.0 is required
Building wheels for collected packages: bcrypt
  Building wheel for bcrypt (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for bcrypt (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [46 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.linux-armv7l-cpython-39
      creating build/lib.linux-armv7l-cpython-39/bcrypt
      copying src/bcrypt/__init__.py -> build/lib.linux-armv7l-cpython-39/bcrypt
      copying src/bcrypt/__about__.py -> build/lib.linux-armv7l-cpython-39/bcrypt
      running egg_info
      writing src/bcrypt.egg-info/PKG-INFO
      writing dependency_links to src/bcrypt.egg-info/dependency_links.txt
      writing requirements to src/bcrypt.egg-info/requires.txt
      writing top-level names to src/bcrypt.egg-info/top_level.txt
      reading manifest file 'src/bcrypt.egg-info/SOURCES.txt'
      reading manifest template 'MANIFEST.in'
      warning: no previously-included files found matching 'requirements.txt'
      warning: no previously-included files found matching 'release.py'
      warning: no previously-included files found matching 'mypy.ini'
      warning: no previously-included files matching '*' found under directory '.github'
      warning: no previously-included files matching '*' found under directory '.circleci'
      warning: no previously-included files found matching 'src/_bcrypt/target'
      warning: no previously-included files matching '*' found under directory 'src/_bcrypt/target'
      adding license file 'LICENSE'
      writing manifest file 'src/bcrypt.egg-info/SOURCES.txt'
      copying src/bcrypt/_bcrypt.pyi -> build/lib.linux-armv7l-cpython-39/bcrypt
      copying src/bcrypt/py.typed -> build/lib.linux-armv7l-cpython-39/bcrypt
      running build_ext
      running build_rust

          =============================DEBUG ASSISTANCE=============================
          If you are seeing a compilation error please try the following steps to
          successfully install bcrypt:
          1) Upgrade to the latest pip and try again. This will fix errors for most
             users. See: https://pip.pypa.io/en/stable/installing/#upgrading-pip
          2) Ensure you have a recent Rust toolchain installed. bcrypt requires
             rustc >= 1.56.0.

          Python: 3.9.2
          platform: Linux-5.15.61-v7+-armv7l-with-glibc2.31
          pip: n/a
          setuptools: 65.3.0
          setuptools_rust: 1.5.1
          rustc: 1.48.0 (471d696c7 2020-12-10)
          =============================DEBUG ASSISTANCE=============================

      error: Rust 1.48.0 does not match extension requirement >=1.56.0
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for bcrypt
Failed to build bcrypt
ERROR: Could not build wheels for bcrypt, which is required to install pyproject.toml-based projects

I fixed this by doing the following:

  1. Determine installed Rust packages and uninstall it
dpkg -l | grep rust

sudo apt remove libstd-rust-*
sudo apt remove rust-gdb
  1. Install the lates stable Rust version
# Follow the setup with default installation
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
  1. Source the new cargo environment
# Put this into your .bashrc/.zshrc/.fishrc etc
source "$HOME/.cargo/env"

Now pip install docker-compose completes without errors.

New 64-bit Raspberry Pi OS Uses different docker_version

With the current defaults I get:

TASK [geerlingguy.docker_arm : Make sure Docker CE is the version specified.] *************************************
fatal: [127.0.0.1]: FAILED! => changed=false 
  cache_update_time: 1590673060
  cache_updated: false
  msg: |-
    '/usr/bin/apt-get -y -o "Dpkg::Options::=--force-confdef" -o "Dpkg::Options::=--force-confold"   --force-yes   install 'docker-ce=5:19.03.8~3-0~raspbian-buster'' failed: W: --force-yes is deprecated, use one of the options starting with --allow instead.
    E: Version '5:19.03.8~3-0~raspbian-buster' for 'docker-ce' was not found
  rc: 100
  stderr: |-
    W: --force-yes is deprecated, use one of the options starting with --allow instead.
    E: Version '5:19.03.8~3-0~raspbian-buster' for 'docker-ce' was not found
  stderr_lines: <omitted>
  stdout: |-
    Reading package lists...
    Building dependency tree...
    Reading state information...
  stdout_lines: <omitted>

For the 64-bit distro it looks like we can just use the ARM64 build for Debian:

# apt search docker
...
docker-ce/buster,now 5:19.03.9~3-0~debian-buster arm64 [installed]
  Docker: the open-source application container engine

docker-ce-cli/buster,now 5:19.03.9~3-0~debian-buster arm64 [installed,automatic]
  Docker CLI: the open-source application container engine

Docker Compose installation using Pip freezes

Here is the task. The process just freezes.

TASK [geerlingguy.docker_arm : Install Docker Compose using Pip.] **********************************************************************************************
task path: /Users/danylevskyi/Projects/rpi-ansible-office/roles/geerlingguy.docker_arm/tasks/main.yml:40
Using module file /usr/local/Cellar/ansible/2.8.5/libexec/lib/python3.7/site-packages/ansible/modules/packaging/language/pip.py
Pipelining is enabled.
<192.168.10.240> ESTABLISH SSH CONNECTION FOR USER: pi
<192.168.10.240> SSH: EXEC ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o 'User="pi"' -o ConnectTimeout=10 -o ControlPath=/tmp/ansible-ssh-%h-%p-%r 192.168.10.240 '/bin/sh -c '"'"'sudo -H -S -n  -u root /bin/sh -c '"'"'"'"'"'"'"'"'echo BECOME-SUCCESS-smewfksnaredglfhkeiflwvkpkmukncm ; /usr/bin/python3'"'"'"'"'"'"'"'"' && sleep 0'"'"''
Escalation succeeded

Role fails on Raspberry Pi OS May 2020 32-bit image

Running this role in Ansible produces:

fatal: [k3s-master]: FAILED! => {"cache_update_time": 1590854762, "cache_updated": false, "changed": false, "msg": "'/usr/bin/apt-get -y -o \"Dpkg::Options::=--force-confdef\" -o \"Dpkg::Options::=--force-confold\"   --force-yes   install 'docker-ce=5:19.03.8~3-0~raspbian-buster'' failed: W: --force-yes is deprecated, use one of the options starting with --allow instead.\nE: Sub-process /usr/bin/dpkg returned an error code (1)\n", "rc": 100, "stderr": "W: --force-yes is deprecated, use one of the options starting with --allow instead.\nE: Sub-process /usr/bin/dpkg returned an error code (1)\n", "stderr_lines": ["W: --force-yes is deprecated, use one of the options starting with --allow instead.", "E: Sub-process /usr/bin/dpkg returned an error code (1)"], "stdout": "Reading package lists...\nBuilding dependency tree...\nReading state information...\nThe following additional packages will be installed:\n  aufs-dkms aufs-tools dkms\nSuggested packages:\n  aufs-dev python3-apport menu\nRecommended packages:\n  cgroupfs-mount | cgroup-lite libltdl7\nThe following NEW packages will be installed:\n  aufs-dkms aufs-tools dkms\nThe following packages will be DOWNGRADED:\n  docker-ce\n0 upgraded, 3 newly installed, 1 downgraded, 0 to remove and 0 not upgraded.\nNeed to get 0 B/15.3 MB of archives.\nAfter this operation, 5305 kB of additional disk space will be used.\nSelecting previously unselected package dkms.\r\n(Reading database ... \r(Reading database ... 5%\r(Reading database ... 10%\r(Reading database ... 15%\r(Reading database ... 20%\r(Reading database ... 25%\r(Reading database ... 30%\r(Reading database ... 35%\r(Reading database ... 40%\r(Reading database ... 45%\r(Reading database ... 50%\r(Reading database ... 55%\r(Reading database ... 60%\r(Reading database ... 65%\r(Reading database ... 70%\r(Reading database ... 75%\r(Reading database ... 80%\r(Reading database ... 85%\r(Reading database ... 90%\r(Reading database ... 95%\r(Reading database ... 100%\r(Reading database ... 97112 files and directories currently installed.)\r\nPreparing to unpack .../archives/dkms_2.6.1-4_all.deb ...\r\nUnpacking dkms (2.6.1-4) ...\r\nSelecting previously unselected package aufs-dkms.\r\nPreparing to unpack .../aufs-dkms_4.19+20190211-1_all.deb ...\r\nUnpacking aufs-dkms (4.19+20190211-1) ...\r\nSelecting previously unselected package aufs-tools.\r\nPreparing to unpack .../aufs-tools_1%3a4.14+20190211-1_armhf.deb ...\r\nUnpacking aufs-tools (1:4.14+20190211-1) ...\r\ndpkg: warning: downgrading docker-ce from 5:19.03.10~3-0~raspbian-buster to 5:19.03.8~3-0~raspbian-buster\r\nPreparing to unpack .../docker-ce_5%3a19.03.8~3-0~raspbian-buster_armhf.deb ...\r\nUnpacking docker-ce (5:19.03.8~3-0~raspbian-buster) over (5:19.03.10~3-0~raspbian-buster) ...\r\nSetting up aufs-tools (1:4.14+20190211-1) ...\r\nSetting up dkms (2.6.1-4) ...\r\nSetting up docker-ce (5:19.03.8~3-0~raspbian-buster) ...\r\nSetting up aufs-dkms (4.19+20190211-1) ...\r\nLoading new aufs-4.19+20190211 DKMS files...\r\nIt is likely that 4.19.118-v7l+ belongs to a chroot's host\r\nBuilding for 4.19.118+, 4.19.118-v7+, 4.19.118-v7l+ and 4.19.118-v8+\r\nBuilding initial module for 4.19.118+\r\nError! Bad return status for module build on kernel: 4.19.118+ (armv7l)\r\nConsult /var/lib/dkms/aufs/4.19+20190211/build/make.log for more information.\r\ndpkg: error processing package aufs-dkms (--configure):\r\n installed aufs-dkms package post-installation script subprocess returned error exit status 10\r\nProcessing triggers for systemd (241-7~deb10u4+rpi1) ...\r\nProcessing triggers for man-db (2.8.5-2) ...\r\nProcessing triggers for libc-bin (2.28-10+rpi1) ...\r\nErrors were encountered while processing:\r\n aufs-dkms\r\n", "stdout_lines": ["Reading package lists...", "Building dependency tree...", "Reading state information...", "The following additional packages will be installed:", "  aufs-dkms aufs-tools dkms", "Suggested packages:", "  aufs-dev python3-apport menu", "Recommended packages:", "  cgroupfs-mount | cgroup-lite libltdl7", "The following NEW packages will be installed:", "  aufs-dkms aufs-tools dkms", "The following packages will be DOWNGRADED:", "  docker-ce", "0 upgraded, 3 newly installed, 1 downgraded, 0 to remove and 0 not upgraded.", "Need to get 0 B/15.3 MB of archives.", "After this operation, 5305 kB of additional disk space will be used.", "Selecting previously unselected package dkms.", "(Reading database ... ", "(Reading database ... 5%", "(Reading database ... 10%", "(Reading database ... 15%", "(Reading database ... 20%", "(Reading database ... 25%", "(Reading database ... 30%", "(Reading database ... 35%", "(Reading database ... 40%", "(Reading database ... 45%", "(Reading database ... 50%", "(Reading database ... 55%", "(Reading database ... 60%", "(Reading database ... 65%", "(Reading database ... 70%", "(Reading database ... 75%", "(Reading database ... 80%", "(Reading database ... 85%", "(Reading database ... 90%", "(Reading database ... 95%", "(Reading database ... 100%", "(Reading database ... 97112 files and directories currently installed.)", "Preparing to unpack .../archives/dkms_2.6.1-4_all.deb ...", "Unpacking dkms (2.6.1-4) ...", "Selecting previously unselected package aufs-dkms.", "Preparing to unpack .../aufs-dkms_4.19+20190211-1_all.deb ...", "Unpacking aufs-dkms (4.19+20190211-1) ...", "Selecting previously unselected package aufs-tools.", "Preparing to unpack .../aufs-tools_1%3a4.14+20190211-1_armhf.deb ...", "Unpacking aufs-tools (1:4.14+20190211-1) ...", "dpkg: warning: downgrading docker-ce from 5:19.03.10~3-0~raspbian-buster to 5:19.03.8~3-0~raspbian-buster", "Preparing to unpack .../docker-ce_5%3a19.03.8~3-0~raspbian-buster_armhf.deb ...", "Unpacking docker-ce (5:19.03.8~3-0~raspbian-buster) over (5:19.03.10~3-0~raspbian-buster) ...", "Setting up aufs-tools (1:4.14+20190211-1) ...", "Setting up dkms (2.6.1-4) ...", "Setting up docker-ce (5:19.03.8~3-0~raspbian-buster) ...", "Setting up aufs-dkms (4.19+20190211-1) ...", "Loading new aufs-4.19+20190211 DKMS files...", "It is likely that 4.19.118-v7l+ belongs to a chroot's host", "Building for 4.19.118+, 4.19.118-v7+, 4.19.118-v7l+ and 4.19.118-v8+", "Building initial module for 4.19.118+", "Error! Bad return status for module build on kernel: 4.19.118+ (armv7l)", "Consult /var/lib/dkms/aufs/4.19+20190211/build/make.log for more information.", "dpkg: error processing package aufs-dkms (--configure):", " installed aufs-dkms package post-installation script subprocess returned error exit status 10", "Processing triggers for systemd (241-7~deb10u4+rpi1) ...", "Processing triggers for man-db (2.8.5-2) ...", "Processing triggers for libc-bin (2.28-10+rpi1) ...", "Errors were encountered while processing:", " aufs-dkms"]}

I believe it is related to this issue with the aufs-dkms package.

not able to install docker-compose on rpi 4 64bit

I got this errors when i was trying to install docker-compose with this script.

pip_package: python3-pip
docker_pip_executable: pip3

pre_tasks:
- apt: update_cache=true

roles:
- geerlingguy.pip
- geerlingguy.docker_arm

TASK [geerlingguy.docker_arm : Install Docker Compose using Pip.] ****************************************************************************************************************************************
fatal: [192.168.65.141]: FAILED! => {"changed": false, "cmd": ["/usr/bin/pip3", "install", "docker-compose"], "msg": "stdout: Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple\nCollecting docker-compose\n Using cached https://files.pythonhosted.org/packages/f3/3e/ca05e486d44e38eb495ca60b8ca526b192071717387346ed1031ecf78966/docker_compose-1.29.2-py2.py3-none-any.whl\nCollecting PyYAML<6,>=3.10 (from docker-compose)\n Using cached https://files.pythonhosted.org/packages/a0/a4/d63f2d7597e1a4b55aa3b4d6c5b029991d3b824b5bd331af8d4ab1ed687d/PyYAML-5.4.1.tar.gz\n Installing build dependencies: started\n Installing build dependencies: finished with status 'done'\nCollecting distro<2,>=1.5.0 (from docker-compose)\n Using cached https://files.pythonhosted.org/packages/b3/8d/a0a5c389d76f90c766e956515d34c3408a1e18f60fbaa08221d1f6b87490/distro-1.6.0-py2.py3-none-any.whl\nCollecting jsonschema<4,>=2.5.1 (from docker-compose)\n Using cached https://files.pythonhosted.org/packages/c5/8f/51e89ce52a085483359217bc72cdbf6e75ee595d5b1d4b5ade40c7e018b8/jsonschema-3.2.0-py2.py3-none-any.whl\nCollecting docopt<1,>=0.6.1 (from docker-compose)\n Using cached https://www.piwheels.org/simple/docopt/docopt-0.6.2-py2.py3-none-any.whl\nCollecting python-dotenv<1,>=0.13.0 (from docker-compose)\n Using cached https://files.pythonhosted.org/packages/f5/d6/4b6268fad900fcb064e4344aa563b22688f0b38dcd857b500b2b5cc445c6/python_dotenv-0.19.0-py2.py3-none-any.whl\nRequirement already satisfied: requests<3,>=2.20.0 in /usr/lib/python3/dist-packages (from docker-compose) (2.21.0)\nCollecting texttable<2,>=0.9.0 (from docker-compose)\n Using cached https://files.pythonhosted.org/packages/75/23/8170868d04b153b1b9ed1bb84348212bb4a08f31b292ef9d7f6ea648fd49/texttable-1.6.4-py2.py3-none-any.whl\nCollecting cached-property<2,>=1.2.0; python_version < "3.8" (from docker-compose)\n Using cached https://files.pythonhosted.org/packages/48/19/f2090f7dad41e225c7f2326e4cfe6fff49e57dedb5b53636c9551f86b069/cached_property-1.5.2-py2.py3-none-any.whl\nCollecting docker[ssh]>=5 (from docker-compose)\n Using cached https://files.pythonhosted.org/packages/b2/5a/f988909dfed18c1ac42ad8d9e611e6c5657e270aa6eb68559985dbb69c13/docker-5.0.0-py2.py3-none-any.whl\nCollecting websocket-client<1,>=0.32.0 (from docker-compose)\n Using cached https://files.pythonhosted.org/packages/f7/0c/d52a2a63512a613817846d430d16a8fbe5ea56dd889e89c68facf6b91cb6/websocket_client-0.59.0-py2.py3-none-any.whl\nCollecting dockerpty<1,>=0.4.1 (from docker-compose)\n Using cached https://www.piwheels.org/simple/dockerpty/dockerpty-0.4.1-py3-none-any.whl\nCollecting pyrsistent>=0.14.0 (from jsonschema<4,>=2.5.1->docker-compose)\n Using cached https://files.pythonhosted.org/packages/f4/d7/0fa558c4fb00f15aabc6d42d365fcca7a15fcc1091cd0f5784a14f390b7f/pyrsistent-0.18.0.tar.gz\n Installing build dependencies: started\n Installing build dependencies: finished with status 'done'\nCollecting importlib-metadata; python_version < "3.8" (from jsonschema<4,>=2.5.1->docker-compose)\n Using cached https://files.pythonhosted.org/packages/07/76/c4674c460f5ff4b5f7a962214e46295e20504dfde9fcba78fd728dfe2ac9/importlib_metadata-4.6.3-py3-none-any.whl\nCollecting attrs>=17.4.0 (from jsonschema<4,>=2.5.1->docker-compose)\n Using cached https://files.pythonhosted.org/packages/20/a9/ba6f1cd1a1517ff022b35acd6a7e4246371dfab08b8e42b829b6d07913cc/attrs-21.2.0-py2.py3-none-any.whl\nRequirement already satisfied: setuptools in /usr/lib/python3/dist-packages (from jsonschema<4,>=2.5.1->docker-compose) (40.8.0)\nRequirement already satisfied: six>=1.11.0 in /usr/lib/python3/dist-packages (from jsonschema<4,>=2.5.1->docker-compose) (1.12.0)\nCollecting paramiko>=2.4.2; extra == "ssh" (from docker[ssh]>=5->docker-compose)\n Using cached https://files.pythonhosted.org/packages/95/19/124e9287b43e6ff3ebb9cdea3e5e8e88475a873c05ccdf8b7e20d2c4201e/paramiko-2.7.2-py2.py3-none-any.whl\nCollecting typing-extensions>=3.6.4; python_version < "3.8" (from importlib-metadata; python_version < "3.8"->jsonschema<4,>=2.5.1->docker-compose)\n Using cached https://files.pythonhosted.org/packages/2e/35/6c4fff5ab443b57116cb1aad46421fb719bed2825664e8fe77d66d99bcbc/typing_extensions-3.10.0.0-py3-none-any.whl\nCollecting zipp>=0.5 (from importlib-metadata; python_version < "3.8"->jsonschema<4,>=2.5.1->docker-compose)\n Using cached https://files.pythonhosted.org/packages/92/d9/89f433969fb8dc5b9cbdd4b4deb587720ec1aeb59a020cf15002b9593eef/zipp-3.5.0-py3-none-any.whl\nCollecting pynacl>=1.0.1 (from paramiko>=2.4.2; extra == "ssh"->docker[ssh]>=5->docker-compose)\n Downloading https://files.pythonhosted.org/packages/cf/5a/25aeb636baeceab15c8e57e66b8aa930c011ec1c035f284170cacb05025e/PyNaCl-1.4.0.tar.gz (3.4MB)\n Installing build dependencies: started\n Installing build dependencies: finished with status 'error'\n Complete output from command /usr/bin/python3 -m pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-zo0h_3b2 --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple --extra-index-url https://www.piwheels.org/simple -- setuptools>=40.8.0 wheel "cffi>=1.4.1; python_implementation != 'PyPy'":\n Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple, https://www.piwheels.org/simple\n Collecting setuptools>=40.8.0\n Using cached https://files.pythonhosted.org/packages/bd/25/5bdf7f1adeebd4e3fa76b2e2f045ae53ee208e40a4231ad0f0c3007e4353/setuptools-57.4.0-py3-none-any.whl\n Collecting wheel\n Using cached https://files.pythonhosted.org/packages/04/80/cad93b40262f5d09f6de82adbee452fd43cdff60830b56a74c5930f7e277/wheel-0.37.0-py2.py3-none-any.whl\n Collecting cffi>=1.4.1\n Using cached https://files.pythonhosted.org/packages/2e/92/87bb61538d7e60da8a7ec247dc048f7671afe17016cd0008b3b710012804/cffi-1.14.6.tar.gz\n Collecting pycparser (from cffi>=1.4.1)\n Using cached https://files.pythonhosted.org/packages/ae/e7/d9c3a176ca4b02024debf82342dab36efadfc5776f9c8db077e8f6e71821/pycparser-2.20-py2.py3-none-any.whl\n Building wheels for collected packages: cffi\n Running setup.py bdist_wheel for cffi: started\n Running setup.py bdist_wheel for cffi: finished with status 'error'\n Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;file='/tmp/pip-install-s43ezo45/cffi/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" bdist_wheel -d /tmp/pip-wheel-ci3bbmz3 --python-tag cp37:\n Package libffi was not found in the pkg-config search path.\n Perhaps you should add the directory containing libffi.pc'\n to the PKG_CONFIG_PATH environment variable\n No package 'libffi' found\n Package libffi was not found in the pkg-config search path.\n Perhaps you should add the directory containing libffi.pc'\n to the PKG_CONFIG_PATH environment variable\n No package 'libffi' found\n Package libffi was not found in the pkg-config search path.\n Perhaps you should add the directory containing libffi.pc'\n to the PKG_CONFIG_PATH environment variable\n No package 'libffi' found\n Package libffi was not found in the pkg-config search path.\n Perhaps you should add the directory containing libffi.pc'\n to the PKG_CONFIG_PATH environment variable\n No package 'libffi' found\n Package libffi was not found in the pkg-config search path.\n Perhaps you should add the directory containing libffi.pc'\n to the PKG_CONFIG_PATH environment variable\n No package 'libffi' found\n running bdist_wheel\n running build\n running build_py\n creating build\n creating build/lib.linux-aarch64-3.7\n creating build/lib.linux-aarch64-3.7/cffi\n copying cffi/ffiplatform.py -> build/lib.linux-aarch64-3.7/cffi\n copying cffi/commontypes.py -> build/lib.linux-aarch64-3.7/cffi\n copying cffi/model.py -> build/lib.linux-aarch64-3.7/cffi\n copying cffi/lock.py -> build/lib.linux-aarch64-3.7/cffi\n copying cffi/vengine_gen.py -> build/lib.linux-aarch64-3.7/cffi\n copying cffi/recompiler.py -> build/lib.linux-aarch64-3.7/cffi\n copying cffi/verifier.py -> build/lib.linux-aarch64-3.7/cffi\n copying cffi/vengine_cpy.py -> build/lib.linux-aarch64-3.7/cffi\n copying cffi/error.py -> build/lib.linux-aarch64-3.7/cffi\n copying cffi/backend_ctypes.py -> build/lib.linux-aarch64-3.7/cffi\n copying cffi/__init__.py -> build/lib.linux-aarch64-3.7/cffi\n copying cffi/cparser.py -> build/lib.linux-aarch64-3.7/cffi\n copying cffi/api.py -> build/lib.linux-aarch64-3.7/cffi\n copying cffi/pkgconfig.py -> build/lib.linux-aarch64-3.7/cffi\n copying cffi/cffi_opcode.py -> build/lib.linux-aarch64-3.7/cffi\n copying cffi/setuptools_ext.py -> build/lib.linux-aarch64-3.7/cffi\n copying cffi/_cffi_include.h -> build/lib.linux-aarch64-3.7/cffi\n copying cffi/parse_c_type.h -> build/lib.linux-aarch64-3.7/cffi\n copying cffi/_embedding.h -> build/lib.linux-aarch64-3.7/cffi\n copying cffi/_cffi_errors.h -> build/lib.linux-aarch64-3.7/cffi\n running build_ext\n building '_cffi_backend' extension\n creating build/temp.linux-aarch64-3.7\n creating build/temp.linux-aarch64-3.7/c\n aarch64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DUSE__THREAD -DHAVE_SYNC_SYNCHRONIZE -I/usr/include/ffi -I/usr/include/libffi -I/usr/include/python3.7m -c c/_cffi_backend.c -o build/temp.linux-aarch64-3.7/c/_cffi_backend.o\n c/_cffi_backend.c:15:10: fatal error: ffi.h: No such file or directory\n #include <ffi.h>\n ^~~~~~~\n compilation terminated.\n error: command 'aarch64-linux-gnu-gcc' failed with exit status 1\n \n ----------------------------------------\n Failed building wheel for cffi\n Running setup.py clean for cffi\n Failed to build cffi\n Installing collected packages: setuptools, wheel, pycparser, cffi\n Running setup.py install for cffi: started\n Running setup.py install for cffi: finished with status 'error'\n Complete output from command /usr/bin/python3 -u -c \"import setuptools, tokenize;__file__='/tmp/pip-install-s43ezo45/cffi/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\\r\\n', '\\n');f.close();exec(compile(code, __file__, 'exec'))\" install --record /tmp/pip-record-qzmso49n/install-record.txt --single-version-externally-managed --prefix /tmp/pip-build-env-zo0h_3b2 --compile:\n Package libffi was not found in the pkg-config search path.\n Perhaps you should add the directory containing libffi.pc'\n to the PKG_CONFIG_PATH environment variable\n No package 'libffi' found\n Package libffi was not found in the pkg-config search path.\n Perhaps you should add the directory containing libffi.pc'\n to the PKG_CONFIG_PATH environment variable\n No package 'libffi' found\n Package libffi was not found in the pkg-config search path.\n Perhaps you should add the directory containing libffi.pc'\n to the PKG_CONFIG_PATH environment variable\n No package 'libffi' found\n Package libffi was not found in the pkg-config search path.\n Perhaps you should add the directory containing libffi.pc'\n to the PKG_CONFIG_PATH environment variable\n No package 'libffi' found\n Package libffi was not found in the pkg-config search path.\n Perhaps you should add the directory containing libffi.pc'\n to the PKG_CONFIG_PATH environment variable\n No package 'libffi' found\n running install\n running build\n running build_py\n creating build\n creating build/lib.linux-aarch64-3.7\n creating build/lib.linux-aarch64-3.7/cffi\n copying cffi/ffiplatform.py -> build/lib.linux-aarch64-3.7/cffi\n copying cffi/commontypes.py -> build/lib.linux-aarch64-3.7/cffi\n copying cffi/model.py -> build/lib.linux-aarch64-3.7/cffi\n copying cffi/lock.py -> build/lib.linux-aarch64-3.7/cffi\n copying cffi/vengine_gen.py -> build/lib.linux-aarch64-3.7/cffi\n copying cffi/recompiler.py -> build/lib.linux-aarch64-3.7/cffi\n copying cffi/verifier.py -> build/lib.linux-aarch64-3.7/cffi\n copying cffi/vengine_cpy.py -> build/lib.linux-aarch64-3.7/cffi\n copying cffi/error.py -> build/lib.linux-aarch64-3.7/cffi\n copying cffi/backend_ctypes.py -> build/lib.linux-aarch64-3.7/cffi\n copying cffi/init.py -> build/lib.linux-aarch64-3.7/cffi\n copying cffi/cparser.py -> build/lib.linux-aarch64-3.7/cffi\n copying cffi/api.py -> build/lib.linux-aarch64-3.7/cffi\n copying cffi/pkgconfig.py -> build/lib.linux-aarch64-3.7/cffi\n copying cffi/cffi_opcode.py -> build/lib.linux-aarch64-3.7/cffi\n copying cffi/setuptools_ext.py -> build/lib.linux-aarch64-3.7/cffi\n copying cffi/_cffi_include.h -> build/lib.linux-aarch64-3.7/cffi\n copying cffi/parse_c_type.h -> build/lib.linux-aarch64-3.7/cffi\n copying cffi/_embedding.h -> build/lib.linux-aarch64-3.7/cffi\n copying cffi/_cffi_errors.h -> build/lib.linux-aarch64-3.7/cffi\n running build_ext\n building '_cffi_backend' extension\n creating build/temp.linux-aarch64-3.7\n creating build/temp.linux-aarch64-3.7/c\n aarch64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DUSE__THREAD -DHAVE_SYNC_SYNCHRONIZE -I/usr/include/ffi -I/usr/include/libffi -I/usr/include/python3.7m -c c/_cffi_backend.c -o build/temp.linux-aarch64-3.7/c/_cffi_backend.o\n c/_cffi_backend.c:15:10: fatal error: ffi.h: No such file or directory\n #include <ffi.h>\n ^~~~~~~\n compilation terminated.\n error: command 'aarch64-linux-gnu-gcc' failed with exit status 1\n \n ----------------------------------------\n Command "/usr/bin/python3 -u -c "import setuptools, tokenize;file='/tmp/pip-install-s43ezo45/cffi/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /tmp/pip-record-qzmso49n/install-record.txt --single-version-externally-managed --prefix /tmp/pip-build-env-zo0h_3b2 --compile" failed with error code 1 in /tmp/pip-install-s43ezo45/cffi/\n \n ----------------------------------------\n\n:stderr: Command "/usr/bin/python3 -m pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-zo0h_3b2 --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple --extra-index-url https://www.piwheels.org/simple -- setuptools>=40.8.0 wheel "cffi>=1.4.1; python_implementation != 'PyPy'"" failed with error code 1 in None\n"}

google helps and i found this:

sudo apt-get install -y libffi-dev libssl-dev
sudo apt-get install -y python3 python3-pip
sudo apt-get remove python-configparser
sudo pip3 -v install docker-compose

and it works.

is it possible to include this in the current srcipt?

Installing in recent Raspberry Pi OS (2022-01-28) fails due to nftables

Just installed the most recent Raspberry Pi OS (2022-01-28, Debian 11.2) on a Raspberry Pi 4 and wanted to install docker_arm as basically the first thing.

hosts: arm
  become: yes
  vars:
    pip_package: python3-pip
  roles:
    - geerlingguy.pip
    - geerlingguy.docker_arm

The installation failed due to docker not starting due to the following error (formatting for better readability is mine):

Running modprobe bridge br_netfilter failed with message:
    modprobe: WARNING: Module bridge not found in directory /lib/modules/5.10.92-v8+
    modprobe: WARNING: Module br_netfilter not found in directory /lib/modules/5.10.92-v8+
  error: exit status 1
Running iptables --wait -t nat -L -n failed with message:
    `iptables/1.8.7 Failed to initialize nft: Protocol not supported`
  error: exit status 1
…
failed to start daemon:
  Error initializing network controller:
    error obtaining controller instance:
      failed to create NAT chain DOCKER:
        iptables failed: iptables -t nat -N DOCKER:
          iptables/1.8.7 Failed to initialize nft: Protocol not supported

So apparently this seems to be due to debian using nftables which docker is not able to. Investigating how to solve this was basically people saying "either write nft rules yourself or configure Debian to use legacy iptables". I did the latter yia

update-alternatives --set iptables /usr/sbin/iptables-legacy
update-alternatives --set ip6tables /usr/sbin/ip6tables-legacy

and it works fine after a reboot. Somehow nftables was mentioned in #14 but there was no further information to find.

I don't know whether reconfiguring in the above way would be sensible for this role (probably not?) but since it was mentioned explicitly somewhere that this role is mainly for Raspberry Pi OS it might be sensible to have some notice somewhere to make people aware?

I'm slightly confused that this problem hasn't come up yet as Debian (and hence Raspberry Pi OS) is using nftables for some time now. Or am I missing something?

armv6 support

Hi,
Are there any reasons why armv6 (for Raspberry Pi Zero) is not supported?
If not, may I make a pull request?

p.s. I'm a fan of your YouTube!! Thanks for the great info!!

Error: /var/run/docker.sock: connect: permission denied

After successfull role application on my rpi:

===============================================================================
geerlingguy.docker_arm : Run Docker install convenience script. ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- 61.03s
geerlingguy.docker_arm : Install Docker Compose using Pip. --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 27.54s
geerlingguy.docker_arm : Make sure Docker CE is the version specified. --------------------------------------------------------------------------------------------------------------------------------------------------------------- 17.59s
Gathering Facts ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 2.26s
geerlingguy.docker_arm : Ensure Docker is started. ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ 1.62s
geerlingguy.docker_arm : Download Docker install convenience script. ------------------------------------------------------------------------------------------------------------------------------------------------------------------ 1.20s
geerlingguy.docker_arm : Check if Docker is already present. -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 0.69s
geerlingguy.docker_arm : Ensure docker users are added to the docker group. ----------------------------------------------------------------------------------------------------------------------------------------------------------- 0.11s
geerlingguy.docker_arm : Ensure containerd service dir exists. ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ 0.05s
geerlingguy.docker_arm : Reload systemd daemon if template is changed. ---------------------------------------------------------------------------------------------------------------------------------------------------------------- 0.05s
geerlingguy.docker_arm : Add shim to ensure Docker can start in all environments. ----------------------------------------------------------------------------------------------------------------------------------------------------- 0.05s

Once trying to run docker after ansible role passed on target machine, I get:

docker ps
Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get http://%2Fvar%2Frun%2Fdocker.sock/v1.24/containers/json: dial unix /var/run/docker.sock: connect: permission denied

Error: Make sure Docker CE is the version specified

I run the playbook:

  • hosts: docker

    vars:
    pip_package: python3-pip

    docker_version_armv6: 5:20.10.83-0raspbian-buster
    docker_version_armv7: 5:20.10.83-0raspbian-buster
    docker_version_arm64: 5:20.10.83-0raspbian-buster
    docker_version: "{{ docker_version_armv7 if 'armv7' in ansible_architecture else docker_version_armv6 if 'armv6' in ansible_architecture else docker_version_arm64 }}"

    roles:

    • common
    • geerlingguy.pip
    • geerlingguy.docker_arm
      become: true

and get the following error.

Any ideas?

TASK [geerlingguy.pip : Ensure Pip is installed.] ********************************************************************************************************************************************************
changed: [192.168.65.141]

TASK [geerlingguy.pip : Ensure pip_install_packages are installed.] **************************************************************************************************************************************

TASK [geerlingguy.docker_arm : Check if Docker is already present.] **************************************************************************************************************************************
ok: [192.168.65.141]

TASK [geerlingguy.docker_arm : Download Docker install convenience script.] ******************************************************************************************************************************
changed: [192.168.65.141]

TASK [geerlingguy.docker_arm : Run Docker install convenience script.] ***********************************************************************************************************************************
changed: [192.168.65.141]

TASK [geerlingguy.docker_arm : Make sure Docker CE is the version specified.] ****************************************************************************************************************************
fatal: [192.168.65.141]: FAILED! => {"cache_update_time": 1628755456, "cache_updated": false, "changed": false, "msg": "'/usr/bin/apt-get -y -o "Dpkg::Options::=--force-confdef" -o "Dpkg::Options::=--force-confold" --force-yes install 'docker-ce=5:20.10.83-0raspbian-buster'' failed: W: --force-yes is deprecated, use one of the options starting with --allow instead.\nE: Version '5:20.10.83-0raspbian-buster' for 'docker-ce' was not found\n", "rc": 100, "stderr": "W: --force-yes is deprecated, use one of the options starting with --allow instead.\nE: Version '5:20.10.83-0raspbian-buster' for 'docker-ce' was not found\n", "stderr_lines": ["W: --force-yes is deprecated, use one of the options starting with --allow instead.", "E: Version '5:20.10.83-0raspbian-buster' for 'docker-ce' was not found"], "stdout": "Reading package lists...\nBuilding dependency tree...\nReading state information...\n", "stdout_lines": ["Reading package lists...", "Building dependency tree...", "Reading state information..."]}

ubuntu-20.04.1-preinstalled-server-arm64+raspi supported?

FWIW I'm a noob to ansible not to linux. I have successfully run some ad-hoc commands and playbooks against a vagrant virtualbox vm and my own rpi4 cluster.

I'm booting 64bit ubuntu-20.04.1-preinstalled-server-arm64+raspi on my Raspberry Pi 4 SBCs. I set the following defaults

docker_version_armv7: ubuntu-20.04.1-preinstalled-server-arm7+raspi
docker_version_arm64: ubuntu-20.04.1-preinstalled-server-arm64+raspi
docker_version: "{{ docker_version_armv7 if 'armv7' in ansible_architecture else docker_version_arm64 }}" 

resulting in 'not found' in the TASK [geerlingguy.docker_arm : Make sure Docker CE is the version specified.]

is the rpi 64bit ubuntu compatible with ansible-role-docker_arm? If so how might I properly configure / overide the defaults?

Also is the rpi 4 arm v8?

Deprecate this role in favor of the regular docker role

Since ARM is pretty much a first-class citizen these days, I've wrapped ARM64 support (out of the box) and multi-arch into the main geerlingguy.docker role, so I don't have to maintain two roles for this anymore.

So after a new release of that role, I need to deprecate and archive this role:

  • Update README to note the role is deprecated in favor of geerlingguy.docker
  • Tag a new release so that README propagates to Galaxy
  • Archive this repository on GitHub
  • Deprecate this role on Galaxy

Unable to uninstall docker

I usually use your docker role to install/uninstall docker in systems.

Since I have to manage some raspberry systems, I also use your docker_arm role.

Today, I want to remove docker from one raspberry. So I configured the variable docker_package_state to "absent", like I do this on all other system. Now I must learn, that the docker_arm role doesn't support this.

It would be great, if the role also support removing docker on the same way the docker role does.

Remove hack to make role work on Raspbian 10 'Buster'

Currently Docker for Linux has no buster packages published, therefore the install convenience script doesn't work on the latest version of Raspbian. Because of this, I added a little hack in #2 that monkey-patches the script to treat debian 9 and 10 as the same, and use the stretch Docker apt repository.

This seems to work okay for now, but as soon as the upstream issue docker/for-linux#709 is fixed, this hack (namely, the task linked below) should be removed:

https://github.com/geerlingguy/ansible-role-docker_arm/blob/master/tasks/main.yml#L15-L21

Permissions issues

I'm running this role with defaults on a freshly installed rasbian lite official image and running into permissions issues.

TASK [geerlingguy.docker_arm : Make sure Docker CE is the version specified.] ***************************************************
 [WARNING]: Updating cache and auto-installing missing dependency: python-apt

fatal: [docker-pi-3]: FAILED! => {"changed": false, "cmd": "apt-get update", "msg": "W: chmod 0700 of directory /var/lib/apt/lists/partial failed - SetupAPTPartialDirectory (1: Operation not permitted)\nE: Could not open lock file /var/lib/apt/lists/lock - open (13: Permission denied)\nE: Unable to lock directory /var/lib/apt/lists/\nW: Problem unlinking the file /var/cache/apt/pkgcache.bin - RemoveCaches (13: Permission denied)\nW: Problem unlinking the file /var/cache/apt/srcpkgcache.bin - RemoveCaches (13: Permission denied)", "rc": 100, "stderr": "W: chmod 0700 of directory /var/lib/apt/lists/partial failed - SetupAPTPartialDirectory (1: Operation not permitted)\nE: Could not open lock file /var/lib/apt/lists/lock - open (13: Permission denied)\nE: Unable to lock directory /var/lib/apt/lists/\nW: Problem unlinking the file /var/cache/apt/pkgcache.bin - RemoveCaches (13: Permission denied)\nW: Problem unlinking the file /var/cache/apt/srcpkgcache.bin - RemoveCaches (13: Permission denied)\n", "stderr_lines": ["W: chmod 0700 of directory /var/lib/apt/lists/partial failed - SetupAPTPartialDirectory (1: Operation not permitted)", "E: Could not open lock file /var/lib/apt/lists/lock - open (13: Permission denied)", "E: Unable to lock directory /var/lib/apt/lists/", "W: Problem unlinking the file /var/cache/apt/pkgcache.bin - RemoveCaches (13: Permission denied)", "W: Problem unlinking the file /var/cache/apt/srcpkgcache.bin - RemoveCaches (13: Permission denied)"], "stdout": "Reading package lists...\n", "stdout_lines": ["Reading package lists..."]}
ansible --version 
ansible 2.8.1
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/home/mat/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3.7/site-packages/ansible
  executable location = /usr/bin/ansible
  python version = 3.7.3 (default, Mar 26 2019, 21:43:19) [GCC 8.2.1 20181127]

I'm using the default pi user as the ansible_user.

I've also hit a similar issue with your very popular pip role (although this example isn't using it), so I'm assuming the issue is on my end somewhere.

Thanks in advance

Primary group for user is changed to docker

The current role currently uses the following to change the group membership:

  user:
    name: "{{ item }}"
    group: docker
    append: true
  with_items: "{{ docker_users }}"

which cause this to happen:

$ id
uid=1000(pi) gid=995(docker) groups=995(docker),4(adm),  ...

The group should be groups. This will leave the user in its original primary group (pi, gid 1000) and only add the user to the docker group.

I also checked your docker role. It correctly uses groups.

reset ssh connection after adding user to docker group

If you use this role in a playbook that afterwards wants to use a docker command, the docker command will fail. This happens because the addition to the docker group takes effect only after resetting the ssh connection.
A solution could be to use the "meta: reset_connection"

Installation failure with Docker 20.10.6 on Debian GNU/Linux 11 (bullseye)

Hello,

I am using this role to install docker onto a raspberry pi 4, 64Bit install.
This is the playbook

$ cat playbooks/install-docker-skelton.yml
---
- hosts: docker_rpi
  become: yes
  vars:
    docker_compose_version: 1.29.2
    docker_version_arm64: 5:20.10.6~3-0~debian-bullseye

    pip_package: python3-pip
    pip_executable: pip3
    pip_install_packages:
      - name: setuptools
      - name: docker
      - name: docker-compose

  roles:
    - geerlingguy.pip
    - geerlingguy.docker_arm

And the output is:

PLAY [docker_rpi] ************************************************************************************************************************************************************************************************

TASK [Gathering Facts] *******************************************************************************************************************************************************************************************
ok: [tn4pi02]

TASK [geerlingguy.pip : Ensure Pip is installed.] ****************************************************************************************************************************************************************
fatal: [tn4pi02]: FAILED! => {"changed": false, "msg": "E:Conflicting values set for option Signed-By regarding source https://download.docker.com/linux/debian/ bullseye: /usr/share/keyrings/docker-archive-keyring.gpg != , E:The list of sources could not be read."}

Checking the local filesystem:

# cat /etc/apt/sources.list.d/docker.list 
deb [arch=arm64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian bullseye stable

And comparing the key here with https://download.docker.com/linux/debian/gpg:

9f3702d8745994675fc9003c6e2b5b26  /usr/share/keyrings/docker-archive-keyring.gpg
1afae06b34a13c1b3d9cb61a26285a15  /dev/fd/63

So they are indeed different.

I've seen this related issue open, but am unsure how to wrangle that into this role

Is there a quick fix for this?
Thanks very much,
Jonathan.

problem with geerlingguy.docker_arm

Hello, I use a raspberry pi 4 with a ubuntu server distro.
I'm not able to use geerlingguy.docker_arm's role in a playbook. I installed it with the command:
ansible-galaxy install geerlingguy.docker_arm.
After that, I write a playbook (docker.yml)

---
- name: "Docker playbook"
  hosts: localhost
  connection: local
  become: yes
  vars:
    docker_install_compose: false
    docker_users:
      - ubuntu
  roles:
    - /home/ubuntu/.ansible/roles/geerlingguy.docker_arm

Finally, I ran the command ansible-playbook docker.yml and that's the result

[WARNING]: provided hosts list is empty, only localhost is available. Note that
the implicit localhost does not match 'all'

PLAY [Docker playbook] *********************************************************

TASK [Gathering Facts] *********************************************************
ok: [localhost]

TASK [/home/ubuntu/.ansible/roles/geerlingguy.docker_arm : Check if Docker is already present.] ***
ok: [localhost]

TASK [/home/ubuntu/.ansible/roles/geerlingguy.docker_arm : Download Docker install convenience script.] ***
skipping: [localhost]

TASK [/home/ubuntu/.ansible/roles/geerlingguy.docker_arm : Run Docker install convenience script.] ***
skipping: [localhost]

TASK [/home/ubuntu/.ansible/roles/geerlingguy.docker_arm : Make sure Docker CE is the version specified.] ***
fatal: [localhost]: FAILED! => {"cache_update_time": 1630497576, "cache_updated": false, "changed": false, "msg": "'/usr/bin/apt-get -y -o \"Dpkg::Options::=--force-confdef\" -o \"Dpkg::Options::=--force-confold\"   --force-yes   install 'docker-ce=5:19.03.9~3-0~debian-buster' -o APT::Install-Recommends=no' failed: W: --force-yes is deprecated, use one of the options starting with --allow instead.\nE: Version '5:19.03.9~3-0~debian-buster' for 'docker-ce' was not found\n", "rc": 100, "stderr": "W: --force-yes is deprecated, use one of the options starting with --allow instead.\nE: Version '5:19.03.9~3-0~debian-buster' for 'docker-ce' was not found\n", "stderr_lines": ["W: --force-yes is deprecated, use one of the options starting with --allow instead.", "E: Version '5:19.03.9~3-0~debian-buster' for 'docker-ce' was not found"], "stdout": "Reading package lists...\nBuilding dependency tree...\nReading state information...\n", "stdout_lines": ["Reading package lists...", "Building dependency tree...", "Reading state information..."]}

PLAY RECAP *********************************************************************
localhost                  : ok=2    changed=0    unreachable=0    failed=1    skipped=2    rescued=0    ignored=0   

Thanks in advance

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.