diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 65246be..d92aa1c 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -13,7 +13,7 @@ jobs: molecule_docker: name: Molecule - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 strategy: matrix: distro: @@ -44,7 +44,7 @@ jobs: molecule_containerd: name: Molecule - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 strategy: matrix: distro: @@ -64,7 +64,7 @@ jobs: python-version: '3.x' - name: Install test dependencies. - run: pip3 install ansible molecule[docker] docker + run: pip3 install ansible molecule-plugins[docker] docker - name: Run Molecule tests. run: molecule test @@ -72,4 +72,4 @@ jobs: PY_COLORS: '1' ANSIBLE_FORCE_COLOR: '1' MOLECULE_DISTRO: ${{ matrix.distro }} - CONTAINERD: '1' \ No newline at end of file + CONTAINERD: '1' diff --git a/tasks/Debian.yml b/tasks/Debian.yml index 899c522..4cda1ca 100644 --- a/tasks/Debian.yml +++ b/tasks/Debian.yml @@ -19,13 +19,11 @@ when: ansible_distribution == "Ubuntu" - name: Add Docker repo key - apt_key: url="https://download.docker.com/linux/debian/gpg" - ignore_errors: yes - register: add_docker_repo - -- name: Add Docker repo key (python 2.7.9 or older) - shell: curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add -qq - >/dev/null - when: add_docker_repo is failed + get_url: + url: "https://download.docker.com/linux/debian/gpg" + dest: /etc/apt/trusted.gpg.d/docker.asc + mode: '0644' + force: true - name: Add docker-ce repo apt_repository: repo='deb [arch=amd64] https://download.docker.com/linux/{{ ansible_distribution|lower }} {{ ansible_distribution_release }} {{ docker_channel }}' diff --git a/tasks/docker.yml b/tasks/docker.yml index 07c7138..6b2c0e3 100644 --- a/tasks/docker.yml +++ b/tasks/docker.yml @@ -107,15 +107,15 @@ ((ansible_os_family == "RedHat" and ansible_distribution_major_version == "7") or (ansible_os_family == "Debian")) + - name: force all notified handlers to run at this point, not waiting for normal sync points + meta: flush_handlers + - name: start docker service: name=docker state=started - name: enable docker service service: name=docker enabled=yes - - name: force all notified handlers to run at this point, not waiting for normal sync points - meta: flush_handlers - when: docker_install | bool - block: