summaryrefslogtreecommitdiffstats
path: root/roles/docker/tasks/main.yml
diff options
context:
space:
mode:
Diffstat (limited to 'roles/docker/tasks/main.yml')
-rw-r--r--roles/docker/tasks/main.yml16
1 files changed, 15 insertions, 1 deletions
diff --git a/roles/docker/tasks/main.yml b/roles/docker/tasks/main.yml
index 0d040a9..c03d897 100644
--- a/roles/docker/tasks/main.yml
+++ b/roles/docker/tasks/main.yml
@@ -1,6 +1,20 @@
---
+#- name: Remove docker
+# yum: name="{{ item }}" state="absent"
+# with_items: [ docker, docker-client, docker-common ]
+
+- name: Remove versionlock from yum
+ command: yum versionlock delete docker docker-common docker-client
+ register: result
+ failed_when: false
+ changed_when: result | failed
+
- name: Ensure docker is installed
- yum: name="docker" state="present"
+ yum: name="docker{{ docker_version | default('') }}" state="{{ docker_version is defined | ternary('latest', 'present') }}"
+
+- name: Add versionlock to yum
+ command: yum versionlock add docker docker-common docker-client
+ when: docker_version is defined
- name: start docker
service: name="docker" state="started"