summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSorin Sbarnea <ssbarnea@redhat.com>2019-01-30 13:53:46 +0000
committerSorin Sbarnea <ssbarnea@redhat.com>2019-02-04 15:21:46 +0000
commit58cf603ce7120de2be1ba069805c754f3c6c50dc (patch)
treebaa0fbd49af92f99b2218bc0f95a6c3d5a6906e7
parenta9ae9ffb0c8700089ffd1a7ded2917e603578a0b (diff)
Make install-docker compatible with centos
Allow custom docker_group which is needed on CentOS when use_upstream_docker: false as is value is 'dockeroot'. Assures that docker service is started, which is not always true with all distributions. Validates that we can talk with docker at the end. Change-Id: I993c4ac35055a2a18b5b0fb32c8b230e04b7eb87
Notes
Notes (review): Code-Review+2: Tobias Henkel <tobias.henkel@bmw.de> Code-Review+2: Mohammed Naser <mnaser@vexxhost.com> Workflow+1: Mohammed Naser <mnaser@vexxhost.com> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Tue, 05 Feb 2019 16:11:33 +0000 Reviewed-on: https://review.openstack.org/633948 Project: openstack-infra/zuul-jobs Branch: refs/heads/master
-rw-r--r--roles/install-docker/defaults/main.yaml1
-rw-r--r--roles/install-docker/tasks/main.yaml22
2 files changed, 21 insertions, 2 deletions
diff --git a/roles/install-docker/defaults/main.yaml b/roles/install-docker/defaults/main.yaml
index 6351680..bef4fbd 100644
--- a/roles/install-docker/defaults/main.yaml
+++ b/roles/install-docker/defaults/main.yaml
@@ -1,4 +1,5 @@
1use_upstream_docker: True 1use_upstream_docker: True
2docker_group: docker
2docker_update_channel: stable 3docker_update_channel: stable
3ubuntu_gpg_key: | 4ubuntu_gpg_key: |
4 -----BEGIN PGP PUBLIC KEY BLOCK----- 5 -----BEGIN PGP PUBLIC KEY BLOCK-----
diff --git a/roles/install-docker/tasks/main.yaml b/roles/install-docker/tasks/main.yaml
index 875d760..d0da85b 100644
--- a/roles/install-docker/tasks/main.yaml
+++ b/roles/install-docker/tasks/main.yaml
@@ -32,8 +32,26 @@
32 user: 32 user:
33 name: "{{ ansible_user }}" 33 name: "{{ ansible_user }}"
34 groups: 34 groups:
35 - docker 35 - "{{ docker_group }}"
36 append: yes 36 append: yes
37 37
38- name: reset ssh connection to pick up docker group 38- name: Assure docker service is running
39 become: yes
40 service:
41 name: docker
42 enabled: yes
43 state: started
44
45- name: Correct group ownership on docker sock
46 become: yes
47 file:
48 path: /var/run/docker.sock
49 group: "{{ docker_group }}"
50
51- name: Reset ssh connection to pick up docker group
39 meta: reset_connection 52 meta: reset_connection
53
54- name: Validate ability to talk with docker
55 command: docker ps
56 args:
57 warn: no