From adeca44281a1554c40a9435da274f10f799bc749 Mon Sep 17 00:00:00 2001 From: David Galloway Date: Thu, 2 Apr 2020 14:16:55 -0400 Subject: [PATCH] testnode: Add support for additional yum repos defined in secrets Signed-off-by: David Galloway --- roles/testnode/README.rst | 13 +++++++++++++ roles/testnode/tasks/yum/repos.yml | 4 ++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/roles/testnode/README.rst b/roles/testnode/README.rst index ebccc5f..69e187d 100644 --- a/roles/testnode/README.rst +++ b/roles/testnode/README.rst @@ -85,6 +85,19 @@ will be used as the properties for the repo file:: gpgcheck: 0 priority: 0 +Another dictionary of yum repos to put in place. We have this dictionary defined in the Octo lab secrets repo. We have devel +repos with baseurls we don't want to expose the URLs of. This dict gets combined with ``yum_repos`` in ``roles/testnode/tasks/yum/repos.yml``:: + + additional_yum_repos: {} + + # An example: + additional_yum_repos: + devel-ceph-repo: + name: This is a repo with devel packages + baseurl: http://some/private/repo/ + enabled: 0 + gpgcheck: 0 + A list of copr repos to enable using ``dnf copr enable``:: copr_repos: [] diff --git a/roles/testnode/tasks/yum/repos.yml b/roles/testnode/tasks/yum/repos.yml index 96a978a..278d8d7 100644 --- a/roles/testnode/tasks/yum/repos.yml +++ b/roles/testnode/tasks/yum/repos.yml @@ -28,8 +28,8 @@ group: root mode: 0644 register: version_repo_file - with_dict: "{{ yum_repos }}" - when: yum_repos.keys() | length > 0 + with_dict: "{{ yum_repos|default({}) | combine(additional_yum_repos|default({}), recursive=True) }}" + when: (yum_repos.keys() | length > 0) or (additional_yum_repos.keys() | length > 0) - name: Enable copr repos command: "dnf -y copr enable {{ item }}" -- 2.39.5