mirror of
https://github.com/Maks1mS/ansible-role-docker.git
synced 2024-12-23 16:22:59 +03:00
Merge pull request #365 from j-koehler/i205-install-docker-packages-explicitly
#205 - install Docker packages explicitly
This commit is contained in:
commit
11345ab410
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
@ -43,11 +43,11 @@ jobs:
|
||||
distro:
|
||||
- rockylinux8
|
||||
- centos7
|
||||
- ubuntu2204
|
||||
- ubuntu2004
|
||||
- ubuntu1804
|
||||
- debian11
|
||||
- debian10
|
||||
- debian9
|
||||
- fedora34
|
||||
|
||||
steps:
|
||||
|
12
README.md
12
README.md
@ -14,10 +14,16 @@ Available variables are listed below, along with default values (see `defaults/m
|
||||
|
||||
# Edition can be one of: 'ce' (Community Edition) or 'ee' (Enterprise Edition).
|
||||
docker_edition: 'ce'
|
||||
docker_package: "docker-{{ docker_edition }}"
|
||||
docker_package_state: present
|
||||
docker_packages:
|
||||
- "docker-{{ docker_edition }}"
|
||||
- "docker-{{ docker_edition }}-cli"
|
||||
- "docker-{{ docker_edition }}-rootless-extras"
|
||||
docker_packages_state: present
|
||||
|
||||
The `docker_edition` should be either `ce` (Community Edition) or `ee` (Enterprise Edition). You can also specify a specific version of Docker to install using the distribution-specific format: Red Hat/CentOS: `docker-{{ docker_edition }}-<VERSION>`; Debian/Ubuntu: `docker-{{ docker_edition }}=<VERSION>`.
|
||||
The `docker_edition` should be either `ce` (Community Edition) or `ee` (Enterprise Edition).
|
||||
You can also specify a specific version of Docker to install using the distribution-specific format:
|
||||
Red Hat/CentOS: `docker-{{ docker_edition }}-<VERSION>` (Note: you have to add this to all packages);
|
||||
Debian/Ubuntu: `docker-{{ docker_edition }}=<VERSION>` (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).
|
||||
|
||||
|
@ -1,8 +1,12 @@
|
||||
---
|
||||
# Edition can be one of: 'ce' (Community Edition) or 'ee' (Enterprise Edition).
|
||||
docker_edition: 'ce'
|
||||
docker_package: "docker-{{ docker_edition }}"
|
||||
docker_package_state: present
|
||||
docker_packages:
|
||||
- "docker-{{ docker_edition }}"
|
||||
- "docker-{{ docker_edition }}-cli"
|
||||
- "docker-{{ docker_edition }}-rootless-extras"
|
||||
- "containerd.io"
|
||||
docker_packages_state: present
|
||||
|
||||
# Service options.
|
||||
docker_service_manage: true
|
||||
|
@ -18,14 +18,13 @@ galaxy_info:
|
||||
- all
|
||||
- name: Debian
|
||||
versions:
|
||||
- stretch
|
||||
- buster
|
||||
- bullseye
|
||||
- name: Ubuntu
|
||||
versions:
|
||||
- xenial
|
||||
- bionic
|
||||
- focal
|
||||
- jammy
|
||||
galaxy_tags:
|
||||
- web
|
||||
- system
|
||||
|
@ -5,18 +5,18 @@
|
||||
- include_tasks: setup-Debian.yml
|
||||
when: ansible_os_family == 'Debian'
|
||||
|
||||
- name: Install Docker.
|
||||
- name: Install Docker packages.
|
||||
package:
|
||||
name: "{{ docker_package }}"
|
||||
state: "{{ docker_package_state }}"
|
||||
name: "{{ docker_packages }}"
|
||||
state: "{{ docker_packages_state }}"
|
||||
notify: restart docker
|
||||
ignore_errors: "{{ ansible_check_mode }}"
|
||||
when: "ansible_version.full is version_compare('2.12', '<') or ansible_os_family not in ['RedHat', 'Debian']"
|
||||
|
||||
- name: Install Docker (with downgrade option).
|
||||
- name: Install Docker packages (with downgrade option).
|
||||
package:
|
||||
name: "{{ docker_package }}"
|
||||
state: "{{ docker_package_state }}"
|
||||
name: "{{ docker_packages }}"
|
||||
state: "{{ docker_packages_state }}"
|
||||
allow_downgrade: true
|
||||
notify: restart docker
|
||||
ignore_errors: "{{ ansible_check_mode }}"
|
||||
|
Loading…
Reference in New Issue
Block a user