summaryrefslogtreecommitdiffstats
path: root/ansible
diff options
context:
space:
mode:
authorBartek Grzybowski <b.grzybowski@partner.samsung.com>2019-04-29 16:13:49 +0200
committerBartek Grzybowski <b.grzybowski@partner.samsung.com>2019-04-30 10:09:44 +0200
commita222de90c7485960f9a7836543fd4bba28bad6f8 (patch)
tree562cd3f79ba984f8fb9a9b08590ffdaa9bfe94e4 /ansible
parentee157b53be7c176081aed96a74fe8ff09b208cb8 (diff)
Make 'prepare-docker' install proper docker-ce version
Docker-ce version should be aligned with Docker release installed on target platform (see build/creating_data/create-rhel-repo.sh) This patch also optimizes package installation process in Molecule tests. Change-Id: I3f0cb7cd36a3f91027b2be43a925e54167d9c6d0 Issue-ID: OOM-1815 Signed-off-by: Bartek Grzybowski <b.grzybowski@partner.samsung.com>
Diffstat (limited to 'ansible')
-rw-r--r--ansible/test/roles/prepare-docker/tasks/docker-packages.yml8
-rw-r--r--ansible/test/roles/prepare-docker/tasks/prepare-docker-repos.yml12
-rw-r--r--ansible/test/roles/prepare-docker/tasks/python-bindings.yml3
-rw-r--r--ansible/test/roles/prepare-docker/tasks/python2-docker.yml28
-rw-r--r--ansible/test/roles/prepare-docker/vars/main.yml9
5 files changed, 27 insertions, 33 deletions
diff --git a/ansible/test/roles/prepare-docker/tasks/docker-packages.yml b/ansible/test/roles/prepare-docker/tasks/docker-packages.yml
new file mode 100644
index 00000000..b7e76c55
--- /dev/null
+++ b/ansible/test/roles/prepare-docker/tasks/docker-packages.yml
@@ -0,0 +1,8 @@
+---
+
+- name: Download docker related packages
+ command: yumdownloader --destdir="{{ rpm_dir }}" "{{ docker_ce_rpm }}" "{{ docker_ce_selinux_rpm }}"
+
+- name: Install docker related packages
+ yum:
+ name: "{{ rpm_dir + '/' + docker_ce_rpm + '.rpm'}},{{ rpm_dir + '/' + docker_ce_selinux_rpm + '.rpm' }}"
diff --git a/ansible/test/roles/prepare-docker/tasks/prepare-docker-repos.yml b/ansible/test/roles/prepare-docker/tasks/prepare-docker-repos.yml
index 26f89d64..f35ffeee 100644
--- a/ansible/test/roles/prepare-docker/tasks/prepare-docker-repos.yml
+++ b/ansible/test/roles/prepare-docker/tasks/prepare-docker-repos.yml
@@ -7,8 +7,16 @@
gpgcheck: true
gpgkey: https://download.docker.com/linux/centos/gpg
-- name: Install docker python bindings
- import_tasks: python-bindings.yml
+- name: Create rpm dir
+ file:
+ path: "{{ rpm_dir }}"
+ state: directory
+
+- name: Handle python2-docker dependency needed by Ansible's docker_* modules
+ import_tasks: python2-docker.yml
+
+- name: Handle docker-ce packages
+ import_tasks: docker-packages.yml
- name: Fake dockerd on container
import_tasks: docker-socket-override.yml
diff --git a/ansible/test/roles/prepare-docker/tasks/python-bindings.yml b/ansible/test/roles/prepare-docker/tasks/python-bindings.yml
deleted file mode 100644
index 7a66a328..00000000
--- a/ansible/test/roles/prepare-docker/tasks/python-bindings.yml
+++ /dev/null
@@ -1,3 +0,0 @@
----
-- name: Handle python2-docker dependency needed by Ansible's docker_* modules
- import_tasks: python2-docker.yml
diff --git a/ansible/test/roles/prepare-docker/tasks/python2-docker.yml b/ansible/test/roles/prepare-docker/tasks/python2-docker.yml
index 9cb3b483..f091cf85 100644
--- a/ansible/test/roles/prepare-docker/tasks/python2-docker.yml
+++ b/ansible/test/roles/prepare-docker/tasks/python2-docker.yml
@@ -4,35 +4,13 @@
name: docker-python
state: absent
-- name: Create own-repo dir
- file:
- path: /root/own-repo
- state: directory
-
- name: Download python2-docker rpm for Ansible (docker_container module dep)
get_url:
- url: https://cbs.centos.org/kojifiles/packages/python-docker/2.5.1/2.el7/noarch/python2-docker-2.5.1-2.el7.noarch.rpm
- dest: /root/own-repo/
+ url: "{{ python2_docker_rpm_url }}"
+ dest: "{{ rpm_dir }}"
register: rpm
-- name: Install createrepo
- package:
- name: createrepo
- state: present
-
-- name: Run createrepo
- command: createrepo /root/own-repo/
- when: rpm.changed
-
-- name: Create own-repo
- yum_repository:
- name: own-repo
- description: Own repo for ansible deps
- baseurl: file:///root/own-repo
- enabled: true
- gpgcheck: false
-
- name: Install docker python module
package:
- name: python2-docker
+ name: "{{ rpm_dir + '/' + python2_docker_rpm }}"
state: present
diff --git a/ansible/test/roles/prepare-docker/vars/main.yml b/ansible/test/roles/prepare-docker/vars/main.yml
index c63c0dea..aabd65dc 100644
--- a/ansible/test/roles/prepare-docker/vars/main.yml
+++ b/ansible/test/roles/prepare-docker/vars/main.yml
@@ -2,6 +2,9 @@
docker_needed_repos:
- /etc/yum.repos.d/CentOS-Base.repo.disabled
- /etc/yum.repos.d/docker-ce.repo.disabled
- - /etc/yum.repos.d/own-repo.repo.disabled
-
-offline_repo_file: /etc/yum.repos.d/onap.repo \ No newline at end of file
+offline_repo_file: /etc/yum.repos.d/onap.repo
+rpm_dir: /root/rpm
+python2_docker_rpm: python2-docker-2.5.1-2.el7.noarch.rpm
+python2_docker_rpm_url: "https://cbs.centos.org/kojifiles/packages/python-docker/2.5.1/2.el7/noarch/{{ python2_docker_rpm }}"
+docker_ce_rpm: docker-ce-17.03.2.ce-1.el7.centos.x86_64
+docker_ce_selinux_rpm: docker-ce-selinux-17.03.3.ce-1.el7.noarch