diff options
author | Michal Zegan <m.zegan@samsung.com> | 2019-05-07 14:31:43 +0200 |
---|---|---|
committer | Michal Zegan <m.zegan@samsung.com> | 2019-05-21 18:20:27 +0200 |
commit | c2996af2cc082cb3386d675eeda12af2d6461821 (patch) | |
tree | edda59bc91d93995a307db5a362005e69b7acb75 /ansible/test | |
parent | b1fe78553ea7d1caf90c1d52e195cd8f2a082008 (diff) |
Add prepare-docker-dind role
This change adds the prepare-docker-dind role intended to
be used in tests to install docker on test containers.
Contrary to the prepare-docker role it arranges for docker daemon to be launched inside
of the test containers instead of using/polluting a test host.
It is a prerequisite to the rke role molecule tests.
Change-Id: I6be270758b01f7e9c4fa09aebcc32930c0977ea3
Issue-ID: OOM-1778
Signed-off-by: Michal Zegan <m.zegan@samsung.com>
Diffstat (limited to 'ansible/test')
-rw-r--r-- | ansible/test/roles/prepare-docker-dind/handlers/main.yml | 5 | ||||
-rw-r--r-- | ansible/test/roles/prepare-docker-dind/tasks/main.yml | 23 | ||||
-rw-r--r-- | ansible/test/roles/prepare-docker-dind/vars/main.yml | 3 |
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 |