diff options
author | Michal Ptacek <m.ptacek@partner.samsung.com> | 2019-05-02 15:09:26 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2019-05-02 15:09:26 +0000 |
commit | 517e4576afcdd6b59a3b552ea394901c2003ca0a (patch) | |
tree | 66f615ea3c8962cfd2f8dba2ae578fc3089b8ed6 /ansible/test | |
parent | 3dc563b8f1d42daf3e6455b40b63525c37001bad (diff) | |
parent | a222de90c7485960f9a7836543fd4bba28bad6f8 (diff) |
Merge "Make 'prepare-docker' install proper docker-ce version"
Diffstat (limited to 'ansible/test')
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 |