diff options
Diffstat (limited to 'ansible/test')
-rw-r--r-- | ansible/test/roles/prepare-package-repository/tasks/main.yml | 26 | ||||
-rw-r--r-- | ansible/test/roles/prepare-package-repository/vars/main.yml | 12 |
2 files changed, 38 insertions, 0 deletions
diff --git a/ansible/test/roles/prepare-package-repository/tasks/main.yml b/ansible/test/roles/prepare-package-repository/tasks/main.yml new file mode 100644 index 00000000..66f81d6d --- /dev/null +++ b/ansible/test/roles/prepare-package-repository/tasks/main.yml @@ -0,0 +1,26 @@ +--- +- name: Add Docker-CE repo + yum_repository: + name: docker-ce + description: Docker-ce YUM repo + baseurl: https://download.docker.com/linux/centos/7/x86_64/stable/ + gpgcheck: true + gpgkey: https://download.docker.com/linux/centos/gpg + +- name: Install createrepo + yum: + name: createrepo + state: present + +- name: "Ensure {{ rhel_pkg_dir }} exists" + file: + path: "{{ rhel_pkg_dir }}" + state: directory + +- name: Download rpm packages + command: "yumdownloader --destdir={{ rhel_pkg_dir }} --resolve {{ packages | join(' ') }}" + +- name: Index repository + command: "createrepo {{ rhel_pkg_dir }}" + args: + creates: "{{ rhel_pkg_dir }}/repodata" diff --git a/ansible/test/roles/prepare-package-repository/vars/main.yml b/ansible/test/roles/prepare-package-repository/vars/main.yml new file mode 100644 index 00000000..80944284 --- /dev/null +++ b/ansible/test/roles/prepare-package-repository/vars/main.yml @@ -0,0 +1,12 @@ +--- +rhel_pkg_dir: "{{ app_data_path }}/pkg/rhel" +packages: +- "docker-ce-18.09.5" +- container-selinux +- docker-ce-cli +- containerd.io +- python-jsonpointer +- python-docker-py +- python-docker-pycreds +- python-ipaddress +- python-websocket-client |