Recent fixes
v2 cover Recent fixes
From: Chuck Lever <[email protected]>
This series was a handful of loosely related patches that I wrote while trying to get kdevops operational on AWS again, for use with NFS workflows. Note that there are still one or two more issues that need to be tracked down before AWS will be working well for me.
These might also be useful for OCI or other cloud providers.
---
v1 of the series was posted here:
https://lore.kernel.org/kdevops/[email protected]/T/#t
I've merged the first three patches of the v1 series.
The second half of the v1 series needed more work. Here are 5/6 and 6/6, reworked. This version is hopefully easier to review and will be easier to add to, going forward.
I've done just a little testing, but found that virt-builder's CentOS images don't appear to work any more because of community changes to the mirror repo hostnames. I left the CentOS logic in place in case someone figures out how to get CentOS working again.
We might also want to think about RHEL 8 / CentOS 8 / OL 8. I expect those will have distinct CRB repo names as well. I'm hoping the refactoring here will make it easy to add those if needed.
Chuck Lever (3):
codereadyrepo: Refactor to prepare for more complex usage scenarios
codereadyrepo: Repo name for Oracle Linux
codereadyrepo: Enable codeready-builder for AWS's RHEL 9
.../roles/codereadyrepo/defaults/main.yml | 6 +++ playbooks/roles/codereadyrepo/tasks/main.yml | 46 ++++++++++++++++--- 2 files changed, 46 insertions(+), 6 deletions(-) create mode 100644 playbooks/roles/codereadyrepo/defaults/main.yml
Signature · 1 line
2.47.1
PATCH v2 1/3 codereadyrepo: Refactor to prepare for more complex usage scenarios
From: Chuck Lever <[email protected]>
I'm about to add a few more cases that the codereadyrepo role needs to handle. The only difference for all of these cases is the name of the repo to enable, so pull out the selection of that name, then do the repo enablement task only when a repo name was found.
--- playbooks/roles/codereadyrepo/tasks/main.yml | 26 +++++++++++++++----- 1 file changed, 20 insertions(+), 6 deletions(-)
playbooks/roles/codereadyrepo/tasks/main.yml +20 -6
@@ -1,14 +1,28 @@ --- -- 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 +- name: Select the RHEL CodeReady Builder repo + ansible.builtin.set_fact: + codeready_repo: "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 +- name: Select the CentOS CodeReady Builder repo + ansible.builtin.set_fact: + codeready_repo: "crb" when: - ansible_distribution == 'CentOS' - not devconfig_custom_yum_repofile + +- name: Enable the selected CodeReady Builder repo + become: true + become_method: ansible.builtin.sudo + ansible.builtin.command: + argv: + - "/usr/bin/dnf" + - "config-manager" + - "--enable" + - "{{ codeready_repo }}" + register: dnf_result + when: + - codeready_repo is defined + changed_when: dnf_result is success
Signature · 1 line
2.47.1
PATCH v2 2/3 codereadyrepo: Repo name for Oracle Linux
In reply to [email protected]From: Chuck Lever <[email protected]>
The name of the CodeReady Builder repo on Oracle Linux is different than the other cases that the codereadyrepo role already supports.
--- playbooks/roles/codereadyrepo/tasks/main.yml | 7 +++++++ 1 file changed, 7 insertions(+)
playbooks/roles/codereadyrepo/tasks/main.yml +7 -0
@@ -6,6 +6,13 @@ - ansible_distribution == 'RedHat' - not devconfig_custom_yum_repofile +- name: Select the Oracle Linux CodeReady Builder repo + ansible.builtin.set_fact: + codeready_repo: "ol9_codeready_builder" + when: + - ansible_distribution == 'OracleLinux' + - not devconfig_custom_yum_repofile + - name: Select the CentOS CodeReady Builder repo ansible.builtin.set_fact: codeready_repo: "crb"
Signature · 1 line
2.47.1
PATCH v2 3/3 codereadyrepo: Enable codeready-builder for AWS's RHEL 9
In reply to [email protected]From: Chuck Lever <[email protected]>
When running the pynfs workflow with target nodes in AWS, "make pynfs" fails with:
Error: No matching repo to modify: codeready-builder-for-rhel-9-x86_64-rpms.
Adjust the logic in the codereadyrepo playbook to sketch in what is needed for running the pynfs workflow in AWS.
Similar adjustments are likely to be necessary for other cloud providers and for other distibutions.
--- playbooks/roles/codereadyrepo/defaults/main.yml | 6 ++++++ playbooks/roles/codereadyrepo/tasks/main.yml | 13 +++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 playbooks/roles/codereadyrepo/defaults/main.yml
playbooks/roles/codereadyrepo/defaults/main.yml new file +6 -0
@@ -0,0 +1,6 @@ +# SPDX-License-Identifier GPL-2.0+ +--- +# Our sensible defaults for the codereadyrepo role. + +kdevops_enable_terraform: false +kdevops_enable_guestfs: false
playbooks/roles/codereadyrepo/tasks/main.yml +13 -0
@@ -5,6 +5,7 @@ when: - ansible_distribution == 'RedHat' - not devconfig_custom_yum_repofile + - kdevops_enable_guestfs - name: Select the Oracle Linux CodeReady Builder repo ansible.builtin.set_fact:
@@ -12,6 +13,7 @@ when: - ansible_distribution == 'OracleLinux' - not devconfig_custom_yum_repofile + - kdevops_enable_guestfs - name: Select the CentOS CodeReady Builder repo ansible.builtin.set_fact:
@@ -19,6 +21,17 @@ when: - ansible_distribution == 'CentOS' - not devconfig_custom_yum_repofile + - kdevops_enable_guestfs + +# Probably need one of these for each cloud provider +- name: Select the AWS RHEL CodeReady Builder repo + ansible.builtin.set_fact: + codeready_repo: "codeready-builder-for-rhel-{{ ansible_distribution_major_version }}-rhui-rpms" + when: + - ansible_distribution == 'RedHat' + - not devconfig_custom_yum_repofile + - kdevops_enable_terraform + - kdevops_terraform_provider == "aws" - name: Enable the selected CodeReady Builder repo become: true
Signature · 1 line
2.47.1