mirror of
https://github.com/Maks1mS/ansible-role-docker.git
synced 2024-12-24 00:33:04 +03:00
Allow package downgrading
For the "package" task, add "allow_downgrade: true" to support this scenario. Because this option is only available starting with `ansible-core>=2.12` for apt-based systems, we need conditional dispatching here.
This commit is contained in:
parent
17633d6cb1
commit
5fe0726d52
@ -5,12 +5,22 @@
|
||||
- include_tasks: setup-Debian.yml
|
||||
when: ansible_os_family == 'Debian'
|
||||
|
||||
- name: Install Docker.
|
||||
- name: Install Docker (Ansible <2.12).
|
||||
package:
|
||||
name: "{{ docker_package }}"
|
||||
state: "{{ docker_package_state }}"
|
||||
notify: restart docker
|
||||
ignore_errors: "{{ ansible_check_mode }}"
|
||||
when: "ansible_version.full is version_compare('2.12', '<')"
|
||||
|
||||
- name: Install Docker (Ansible >=2.12).
|
||||
package:
|
||||
name: "{{ docker_package }}"
|
||||
state: "{{ docker_package_state }}"
|
||||
allow_downgrade: true
|
||||
notify: restart docker
|
||||
ignore_errors: "{{ ansible_check_mode }}"
|
||||
when: "ansible_version.full is version_compare('2.12', '>=')"
|
||||
|
||||
- name: Ensure /etc/docker/ directory exists.
|
||||
file:
|
||||
|
Loading…
Reference in New Issue
Block a user