summaryrefslogtreecommitdiffstats
path: root/ansible
diff options
context:
space:
mode:
authorSamuli Silvius <s.silvius@partner.samsung.com>2019-05-30 10:46:07 +0000
committerGerrit Code Review <gerrit@onap.org>2019-05-30 10:46:07 +0000
commit7e5ddf0b3e0f23bf499b3311340253485d06fc33 (patch)
treee5ba8ad405bb6b050bdb070f6f4512aa3e1faf8b /ansible
parentb78bbf8e835cf9bd3f1b73bea1d7d67680f451fc (diff)
parentc2996af2cc082cb3386d675eeda12af2d6461821 (diff)
Merge "Add prepare-docker-dind role"
Diffstat (limited to 'ansible')
-rw-r--r--ansible/test/roles/prepare-docker-dind/handlers/main.yml5
-rw-r--r--ansible/test/roles/prepare-docker-dind/tasks/main.yml23
-rw-r--r--ansible/test/roles/prepare-docker-dind/vars/main.yml3
3 files changed, 31 insertions, 0 deletions
diff --git a/ansible/test/roles/prepare-docker-dind/handlers/main.yml b/ansible/test/roles/prepare-docker-dind/handlers/main.yml
new file mode 100644
index 00000000..698e3d3f
--- /dev/null
+++ b/ansible/test/roles/prepare-docker-dind/handlers/main.yml
@@ -0,0 +1,5 @@
+- name: Restart docker
+ service:
+ name: docker
+ enabled: true
+ state: restarted
diff --git a/ansible/test/roles/prepare-docker-dind/tasks/main.yml b/ansible/test/roles/prepare-docker-dind/tasks/main.yml
new file mode 100644
index 00000000..3e109e87
--- /dev/null
+++ b/ansible/test/roles/prepare-docker-dind/tasks/main.yml
@@ -0,0 +1,23 @@
+---
+# Needed because host system has all mounts by default to shared, and
+# some things may depend on mounts being shared if we run docker inside
+# test env.
+- name: "Make all mounts shared"
+ command: "mount --make-rshared /"
+ args:
+ warn: false
+
+- name: "Enable docker repository"
+ yum_repository:
+ name: "Docker"
+ description: Docker-ce repository
+ enabled: yes
+ baseurl: "https://download.docker.com/linux/centos/7/$basearch/stable"
+ gpgcheck: yes
+ gpgkey: https://download.docker.com/linux/centos/gpg
+
+- name: "Install docker"
+ package:
+ name: "docker-ce-{{ docker_version }}"
+ state: present
+ notify: Restart docker
diff --git a/ansible/test/roles/prepare-docker-dind/vars/main.yml b/ansible/test/roles/prepare-docker-dind/vars/main.yml
new file mode 100644
index 00000000..950fb921
--- /dev/null
+++ b/ansible/test/roles/prepare-docker-dind/vars/main.yml
@@ -0,0 +1,3 @@
+---
+#The version of docker to install
+docker_version: 18.09.5