]> git.apps.os.sepia.ceph.com Git - ceph-cm-ansible.git/commitdiff
testnode: Support adding copr repos 501/head
authorDavid Galloway <dgallowa@redhat.com>
Thu, 12 Dec 2019 16:46:39 +0000 (11:46 -0500)
committerDavid Galloway <dgallowa@redhat.com>
Thu, 12 Dec 2019 17:12:31 +0000 (12:12 -0500)
Signed-off-by: David Galloway <dgallowa@redhat.com>
roles/testnode/README.rst
roles/testnode/defaults/main.yml
roles/testnode/tasks/yum/repos.yml
roles/testnode/vars/centos_8.yml
roles/testnode/vars/redhat_8.yml

index ada57c55e7dfa929f9f64ac98eb1c11e685031f6..2ac60a8dd94ab31f61e72be193808a0563b72684 100644 (file)
@@ -85,6 +85,14 @@ will be used as the properties for the repo file::
         gpgcheck: 0
         priority: 0
 
+A list of copr repos to enable using ``dnf copr enable``::
+
+    copr_repos: []
+
+    # An example:
+    copr_repos:
+      - ktdreyer/ceph-el8
+
 A list defining apt repos that would be common across a major version or distro. Each item in the list represents
 an apt repo to be added to sources.list::
 
index f4c61fe49e86be2b9b7ccb1b175b11b1c0509c6f..837f959b16ac2390b7387833428d6a69bfd42155 100644 (file)
@@ -11,6 +11,9 @@ common_yum_repos: {}
 # version-specific yum repos, defined in the version specific var file
 yum_repos: {}
 
+# list of copr repo *names* to enable (e.g., user/repo)
+copr_repos: []
+
 # apt repos common to a major version or distro
 common_apt_repos: []
 
index 9ca8b3ce2d133f39b99e9b64612075c93bef81b9..2af361e4b8579fc0bdfb8b8f321686945cbd37ba 100644 (file)
   with_dict: "{{ yum_repos }}"
   when: yum_repos.keys() | length > 0
 
+- name: Enable copr repos
+  command: "dnf -y copr enable {{ item }}"
+  with_items: "{{ copr_repos }}"
+  when:
+    - (ansible_os_family == "RedHat" and ansible_distribution_major_version|int >= 8)
+    - copr_repos|length > 0
+
 - import_tasks: gpg_keys.yml
   when: ansible_distribution == "Fedora"
   tags:
index dd2ec748f4b941b6edbf1d77842c96aac158dc4a..d91985c9343404d3d4efc39c7621812be148fcb6 100644 (file)
@@ -1,5 +1,5 @@
 ---
-# vars specific to any rhel 8.x version
+# vars specific to any centos 8.x version
 
 common_yum_repos:
   lab-extras:
@@ -8,6 +8,9 @@ common_yum_repos:
     enabled: 1
     gpgcheck: 0
 
+copr_repos:
+  - ktdreyer/ceph-el8
+
 packages:
   - '@core'
   - '@base'
index 082acfa6765271cad8bc9db532af4c82b23da822..3236d6ade142e5e887c4b01974dd2e01fd4fa8da 100644 (file)
@@ -8,6 +8,9 @@ common_yum_repos:
     enabled: 1
     gpgcheck: 0
 
+copr_repos:
+  - ktdreyer/ceph-el8
+
 packages:
   - '@core'
   - '@base'