diff --git a/README.md b/README.md index 953b7dd..2c85482 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ You can also specify a specific version of Docker to install using the distribut Red Hat/CentOS: `docker-{{ docker_edition }}-` (Note: you have to add this to all packages); Debian/Ubuntu: `docker-{{ docker_edition }}=` (Note: you have to add this to all packages). -You can control whether the package is installed, uninstalled, or at the latest version by setting `docker_package_state` to `present`, `absent`, or `latest`, respectively. Note that the Docker daemon will be automatically restarted if the Docker package is updated. This is a side effect of flushing all handlers (running any of the handlers that have been notified by this and any other role up to this point in the play). +You can control whether the package is installed, uninstalled, or at the latest version by setting `docker_packages_state` to `present`, `absent`, or `latest`, respectively. Note that the Docker daemon will be automatically restarted if the Docker package is updated. This is a side effect of flushing all handlers (running any of the handlers that have been notified by this and any other role up to this point in the play). docker_service_manage: true docker_service_state: started @@ -60,6 +60,7 @@ The main Docker repo URL, common between Debian and RHEL systems. docker_apt_repository: "deb [arch={{ docker_apt_arch }}] {{ docker_repo_url }}/{{ ansible_distribution | lower }} {{ ansible_distribution_release }} {{ docker_apt_release_channel }}" docker_apt_ignore_key_error: True docker_apt_gpg_key: "{{ docker_repo_url }}/{{ ansible_distribution | lower }}/gpg" + docker_apt_filename: "" (Used only for Debian/Ubuntu.) You can switch the channel to `nightly` if you want to use the Nightly release. diff --git a/defaults/main.yml b/defaults/main.yml index 9d009fd..f0caab8 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -15,12 +15,12 @@ docker_service_enabled: true docker_restart_handler_state: restarted # Docker Compose Plugin options. -docker_install_compose_plugin: false +docker_install_compose_plugin: true docker_compose_package: docker-compose-plugin docker_compose_package_state: present # Docker Compose options. -docker_install_compose: true +docker_install_compose: false docker_compose_version: "v2.11.1" docker_compose_arch: "{{ ansible_facts.architecture }}" docker_compose_url: "https://github.com/docker/compose/releases/download/{{ docker_compose_version }}/docker-compose-linux-{{ docker_compose_arch }}" @@ -32,13 +32,17 @@ docker_add_repo: true # Docker repo URL. docker_repo_url: https://download.docker.com/linux -# Used only for Debian/Ubuntu. Switch 'stable' to 'nightly' if needed. +# Used only for Debian/Ubuntu/Pop!_OS/Linux Mint. Switch 'stable' to 'nightly' if needed. docker_apt_release_channel: stable +# docker_apt_ansible_distribution is a workaround for Ubuntu variants which can't be identified as such by Ansible, +# and is only necessary until Docker officially supports them. +docker_apt_ansible_distribution: "{{ 'ubuntu' if ansible_facts.distribution in ['Pop!_OS', 'Linux Mint'] else ansible_facts.distribution }}" docker_apt_arch: "{{ 'arm64' if ansible_facts.architecture == 'aarch64' else 'amd64' }}" docker_apt_repository: "deb [arch={{ docker_apt_arch }} signed-by=/etc/apt/trusted.gpg.d/docker.asc] {{ docker_repo_url }}/{{ ansible_facts.distribution | lower }} {{ ansible_facts.distribution_release }} {{ docker_apt_release_channel }}" docker_apt_ignore_key_error: true docker_apt_gpg_key: "{{ docker_repo_url }}/{{ ansible_facts.distribution | lower }}/gpg" docker_apt_gpg_key_checksum: "sha256:1500c1f56fa9e26b9b8f42452a553675796ade0807cdce11975eb98170b3a570" +docker_apt_filename: "docker" # Used only for RedHat/CentOS/Fedora. docker_yum_repo_url: "{{ docker_repo_url }}/{{ (ansible_facts.distribution == 'Fedora') | ternary('fedora','centos') }}/docker-{{ docker_edition }}.repo" diff --git a/tasks/setup-Debian.yml b/tasks/setup-Debian.yml index 8e1c5b9..6ac5736 100644 --- a/tasks/setup-Debian.yml +++ b/tasks/setup-Debian.yml @@ -50,5 +50,6 @@ apt_repository: repo: "{{ docker_apt_repository }}" state: present + filename: "{{ docker_apt_filename }}" update_cache: true when: docker_add_repo | bool diff --git a/tasks/setup-RedHat.yml b/tasks/setup-RedHat.yml index d65635f..edb3812 100644 --- a/tasks/setup-RedHat.yml +++ b/tasks/setup-RedHat.yml @@ -44,6 +44,11 @@ - name: Configure containerd on RHEL 8. block: + - name: Ensure runc is not installed. + package: + name: runc + state: absent + - name: Ensure container-selinux is installed. package: name: container-selinux