Force install of specified docker version, fixes #295

This allows Ubuntu/Debian to downgrade Docker version if
a newer version is installed, instead of failing.
This commit is contained in:
Matthew Mosesohn 2016-06-16 19:12:11 +03:00
parent 153b82a803
commit 33d897bcb6
8 changed files with 12 additions and 8 deletions

View file

@ -48,7 +48,8 @@
- name: ensure docker packages are installed
action: "{{ docker_package_info.pkg_mgr }}"
args:
pkg: "{{item}}"
pkg: "{{item.name}}"
force: "{{item.force|default(omit)}}"
state: present
with_items: "{{ docker_package_info.pkgs }}"
when: (ansible_os_family != "CoreOS") and (docker_package_info.pkgs|length > 0)

View file

@ -5,7 +5,7 @@ docker_kernel_min_version: '2.6.32-431'
docker_package_info:
pkg_mgr: yum
pkgs:
- docker-io
- name: docker-io
docker_repo_key_info:
pkg_key: ''

View file

@ -9,7 +9,8 @@ docker_versioned_pkg:
docker_package_info:
pkg_mgr: apt
pkgs:
- "{{ docker_versioned_pkg[docker_version] }}"
- name: "{{ docker_versioned_pkg[docker_version] }}"
force: yes
docker_repo_key_info:
pkg_key: apt_key

View file

@ -5,7 +5,7 @@ docker_kernel_min_version: '0'
docker_package_info:
pkg_mgr: yum
pkgs:
- docker-io
- name: docker-io
docker_repo_key_info:
pkg_key: ''

View file

@ -8,7 +8,7 @@ docker_versioned_pkg:
docker_package_info:
pkg_mgr: dnf
pkgs:
- "{{ docker_versioned_pkg[docker_version] }}"
- name: "{{ docker_versioned_pkg[docker_version] }}"
docker_repo_key_info:
pkg_key: ''

View file

@ -3,7 +3,7 @@ docker_kernel_min_version: '0'
docker_package_info:
pkg_mgr: yum
pkgs:
- docker-engine
- name: docker-engine
docker_repo_key_info:
pkg_key: ''

View file

@ -10,7 +10,8 @@ docker_versioned_pkg:
docker_package_info:
pkg_mgr: apt
pkgs:
- "{{ docker_versioned_pkg[docker_version] }}"
- name: "{{ docker_versioned_pkg[docker_version] }}"
force: yes
docker_repo_key_info:
pkg_key: apt_key

View file

@ -10,7 +10,8 @@ docker_versioned_pkg:
docker_package_info:
pkg_mgr: apt
pkgs:
- "{{ docker_versioned_pkg[docker_version] }}"
- name: "{{ docker_versioned_pkg[docker_version] }}"
force: yes
docker_repo_key_info:
pkg_key: apt_key