From 90d9b9b7d9f9fcdcd0f8d7b21a82ab87d43b604b Mon Sep 17 00:00:00 2001 From: Mohammed Naser Date: Sat, 4 Apr 2020 16:00:03 -0400 Subject: [PATCH] ensure-kubernetes: refactor to use ensure-package-repositories This patch refactors ensure-kubernetes to use the new generic role to allow it to be cross-platform in the future. Change-Id: Ic90c8973431823814c7e6b122f4ef25a67d64c2f --- roles/ensure-kubernetes/tasks/main.yaml | 19 ++++++++----------- zuul-tests.d/container-roles-jobs.yaml | 5 +++++ 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/roles/ensure-kubernetes/tasks/main.yaml b/roles/ensure-kubernetes/tasks/main.yaml index fa350eb75..25535ab8c 100644 --- a/roles/ensure-kubernetes/tasks/main.yaml +++ b/roles/ensure-kubernetes/tasks/main.yaml @@ -1,14 +1,11 @@ -- name: Install apt key - become: yes - apt_key: - url: "https://packages.cloud.google.com/apt/doc/apt-key.gpg" - state: present - -- name: Add kubernetes repo - become: yes - apt_repository: - repo: deb http://apt.kubernetes.io/ kubernetes-xenial main - state: present +- name: Add all repositories + include_role: + name: ensure-package-repositories + vars: + repositories_keys: + - url: https://packages.cloud.google.com/apt/doc/apt-key.gpg + repositories_list: + - repo: deb http://apt.kubernetes.io/ kubernetes-xenial main - name: Install kubernetes packages and dependencies become: yes diff --git a/zuul-tests.d/container-roles-jobs.yaml b/zuul-tests.d/container-roles-jobs.yaml index be062dc4c..3a8c9239e 100644 --- a/zuul-tests.d/container-roles-jobs.yaml +++ b/zuul-tests.d/container-roles-jobs.yaml @@ -140,6 +140,7 @@ - roles/push-to-intermediate-registry/.* - roles/ensure-docker/.* - roles/ensure-kubernetes/.* + - roles/ensure-package-repositories/.* - roles/build-docker-image/.* - roles/run-buildset-registry/.* - roles/use-buildset-registry/.* @@ -163,6 +164,7 @@ - roles/push-to-intermediate-registry/.* - roles/ensure-docker/.* - roles/ensure-kubernetes/.* + - roles/ensure-package-repositories/.* - roles/build-docker-image/.* - roles/run-buildset-registry/.* - roles/use-buildset-registry/.* @@ -187,6 +189,7 @@ - roles/push-to-intermediate-registry/.* - roles/ensure-docker/.* - roles/ensure-kubernetes/.* + - roles/ensure-package-repositories/.* - roles/build-docker-image/.* - roles/run-buildset-registry/.* - roles/use-buildset-registry/.* @@ -236,6 +239,7 @@ files: - roles/ensure-docker/.* - roles/ensure-kubernetes/.* + - roles/ensure-package-repositories/.* - test-playbooks/ensure-kubernetes/.* run: test-playbooks/ensure-kubernetes/docker.yaml post-run: test-playbooks/ensure-kubernetes/post.yaml @@ -251,6 +255,7 @@ files: - roles/ensure-docker/.* - roles/ensure-kubernetes/.* + - roles/ensure-package-repositories/.* - test-playbooks/ensure-kubernetes/.* run: test-playbooks/ensure-kubernetes/crio.yaml post-run: test-playbooks/ensure-kubernetes/post.yaml