public inbox for kdevops@lists.linux.dev
 help / color / mirror / Atom feed
From: cel@kernel.org
To: <kdevops@lists.linux.dev>
Cc: Anna Schumaker <anna@kernel.org>, Chuck Lever <chuck.lever@oracle.com>
Subject: [PATCH 5/6] playbooks: Add a Code Ready Builder role
Date: Tue, 10 Dec 2024 14:29:18 -0500	[thread overview]
Message-ID: <20241210192920.682914-6-cel@kernel.org> (raw)
In-Reply-To: <20241210192920.682914-1-cel@kernel.org>

From: Chuck Lever <chuck.lever@oracle.com>

Installing Code Ready Builder turns out to be complicated by the way
the package is named on various cloud providers. Since there is more
than one workflow that wants to install CRB, move the installation
mechanism to its own role so that can be included in each workflow
that might need it.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
 playbooks/roles/codereadyrepo/tasks/main.yml       | 14 ++++++++++++++
 .../fstests/tasks/install-deps/redhat/main.yml     | 14 ++------------
 .../roles/pynfs/tasks/install-deps/redhat/main.yml | 14 ++------------
 .../sysbench/tasks/install-deps/redhat/main.yml    | 14 ++------------
 4 files changed, 20 insertions(+), 36 deletions(-)
 create mode 100644 playbooks/roles/codereadyrepo/tasks/main.yml

diff --git a/playbooks/roles/codereadyrepo/tasks/main.yml b/playbooks/roles/codereadyrepo/tasks/main.yml
new file mode 100644
index 000000000000..71ad05c9d539
--- /dev/null
+++ b/playbooks/roles/codereadyrepo/tasks/main.yml
@@ -0,0 +1,14 @@
+---
+- name: Enable the CodeReady repo
+  become: yes
+  ansible.builtin.command: /usr/bin/dnf config-manager --enable codeready-builder-for-rhel-{{ ansible_distribution_major_version }}-{{ ansible_architecture }}-rpms
+  when:
+    - ansible_distribution == 'RedHat'
+    - not devconfig_custom_yum_repofile
+
+- name: Enable the CodeReady repo
+  become: yes
+  ansible.builtin.command: /usr/bin/dnf config-manager --enable crb
+  when:
+    - ansible_distribution == 'CentOS'
+    - not devconfig_custom_yum_repofile
diff --git a/playbooks/roles/fstests/tasks/install-deps/redhat/main.yml b/playbooks/roles/fstests/tasks/install-deps/redhat/main.yml
index 1c238979d7d5..655afa3b9cc8 100644
--- a/playbooks/roles/fstests/tasks/install-deps/redhat/main.yml
+++ b/playbooks/roles/fstests/tasks/install-deps/redhat/main.yml
@@ -1,17 +1,7 @@
 ---
 - name: Enable the CodeReady repo
-  become: yes
-  command: /usr/bin/dnf config-manager --enable codeready-builder-for-rhel-{{ ansible_distribution_major_version }}-{{ ansible_architecture }}-rpms
-  when:
-    - ansible_distribution == 'RedHat'
-    - not devconfig_custom_yum_repofile
-
-- name: Enable the CodeReady repo
-  become: yes
-  command: /usr/bin/dnf config-manager --enable crb
-  when:
-    - ansible_distribution == 'CentOS'
-    - not devconfig_custom_yum_repofile
+  ansible.builtin.include_role:
+    name: codereadyrepo
 
 - name: Install epel-release if we're not on Fedora
   become: yes
diff --git a/playbooks/roles/pynfs/tasks/install-deps/redhat/main.yml b/playbooks/roles/pynfs/tasks/install-deps/redhat/main.yml
index f4aee14c5430..93513c426263 100644
--- a/playbooks/roles/pynfs/tasks/install-deps/redhat/main.yml
+++ b/playbooks/roles/pynfs/tasks/install-deps/redhat/main.yml
@@ -1,17 +1,7 @@
 ---
 - name: Enable the CodeReady repo
-  become: yes
-  command: /usr/bin/dnf config-manager --enable codeready-builder-for-rhel-{{ ansible_distribution_major_version }}-{{ ansible_architecture }}-rpms
-  when:
-    - ansible_distribution == 'RedHat'
-    - not devconfig_custom_yum_repofile
-
-- name: Enable the CodeReady repo
-  become: yes
-  command: /usr/bin/dnf config-manager --enable crb
-  when:
-    - ansible_distribution == 'CentOS'
-    - not devconfig_custom_yum_repofile
+  ansible.builtin.include_role:
+    name: codereadyrepo
 
 - name: Install build dependencies for pynfs
   become: yes
diff --git a/playbooks/roles/sysbench/tasks/install-deps/redhat/main.yml b/playbooks/roles/sysbench/tasks/install-deps/redhat/main.yml
index abe95cb0c5a0..4602d7e6cf5a 100644
--- a/playbooks/roles/sysbench/tasks/install-deps/redhat/main.yml
+++ b/playbooks/roles/sysbench/tasks/install-deps/redhat/main.yml
@@ -1,17 +1,7 @@
 ---
 - name: Enable the CodeReady repo
-  become: yes
-  command: /usr/bin/dnf config-manager --enable codeready-builder-for-rhel-{{ ansible_distribution_major_version }}-{{ ansible_architecture }}-rpms
-  when:
-    - ansible_distribution == 'RedHat'
-    - not devconfig_custom_yum_repofile
-
-- name: Enable the CodeReady repo
-  become: yes
-  command: /usr/bin/dnf config-manager --enable crb
-  when:
-    - ansible_distribution == 'CentOS'
-    - not devconfig_custom_yum_repofile
+  ansible.builtin.include_role:
+    name: codereadyrepo
 
 - name: Install epel-release if we're not on Fedora
   become: yes
-- 
2.47.0


  parent reply	other threads:[~2024-12-10 19:29 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-10 19:29 [PATCH 0/6] Recent fixes cel
2024-12-10 19:29 ` [PATCH 1/6] fstests: Fix NFS mount options for fstests cel
2024-12-10 19:29 ` [PATCH 2/6] gen_nodes: Fix generation of the list of test nodes cel
2024-12-10 19:29 ` [PATCH 3/6] fstests: Fix selection of NFSD export type for the pNFS test section cel
2024-12-10 19:29 ` [PATCH 4/6] NFSD: Implement NVMe storage for NFSD exports cel
2024-12-11  3:42   ` Luis Chamberlain
2024-12-11 13:50     ` Chuck Lever
2024-12-12  2:28       ` Luis Chamberlain
2024-12-10 19:29 ` cel [this message]
2024-12-10 19:29 ` [PATCH 6/6] codereadyrepo: Enable codeready-builder in AWS cel
2024-12-11  3:44 ` [PATCH 0/6] Recent fixes Luis Chamberlain

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241210192920.682914-6-cel@kernel.org \
    --to=cel@kernel.org \
    --cc=anna@kernel.org \
    --cc=chuck.lever@oracle.com \
    --cc=kdevops@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox