summaryrefslogtreecommitdiffstats
path: root/roles/docker/tasks/install.yml
blob: 41ae5a30abc10c01c60f9c9dec5804165542e4b2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
- name: Remove versionlock from yum
  command: yum versionlock delete docker docker-common docker-client
  register: result
  when: update | default(false)
  failed_when: false
  changed_when: result | failed

- name: Ensure docker is installed
  yum: name="docker{{ docker_version | default('') }}" state="{{ ((docker_version is defined) and (update | default(false))) | ternary('latest', 'present') }}"

- name: Add versionlock to yum
  command: yum versionlock add docker docker-common docker-client
  when: docker_version is defined