Browse Source
Merge pull request #2057 from rsmitty/master
set docker_version fact regardless of docker_dns in use
pull/2067/head
Spencer Smith
7 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
12 additions and
3 deletions
-
roles/docker/tasks/main.yml
|
|
@ -71,12 +71,21 @@ |
|
|
|
notify: restart docker |
|
|
|
when: not (ansible_os_family in ["CoreOS", "Container Linux by CoreOS"] or is_atomic) and (docker_package_info.pkgs|length > 0) |
|
|
|
|
|
|
|
- name: check minimum docker version for docker_dns mode. You need at least docker version >= 1.12 for resolvconf_mode=docker_dns |
|
|
|
- name: flush handlers so we can wait for docker to come up |
|
|
|
meta: flush_handlers |
|
|
|
|
|
|
|
- name: set fact for docker_version |
|
|
|
command: "docker version -f '{{ '{{' }}.Client.Version{{ '}}' }}'" |
|
|
|
register: docker_version |
|
|
|
failed_when: docker_version.stdout|version_compare('1.12', '<') |
|
|
|
changed_when: false |
|
|
|
when: dns_mode != 'none' and resolvconf_mode == 'docker_dns' |
|
|
|
|
|
|
|
- name: check minimum docker version for docker_dns mode. You need at least docker version >= 1.12 for resolvconf_mode=docker_dns |
|
|
|
fail: |
|
|
|
msg: "You need at least docker version >= 1.12 for resolvconf_mode=docker_dns" |
|
|
|
when: > |
|
|
|
dns_mode != 'none' and |
|
|
|
resolvconf_mode == 'docker_dns' and |
|
|
|
docker_version.stdout|version_compare('1.12', '<') |
|
|
|
|
|
|
|
- name: Set docker systemd config |
|
|
|
include: systemd.yml |
|
|
|