From patchwork Tue Dec 10 19:29:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuck Lever X-Patchwork-Id: 13901963 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3593723ED63 for ; Tue, 10 Dec 2024 19:29:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733858967; cv=none; b=LNcXz94s9Pc3MKKO1S70BlB9kJBdNm7ZHHbjSf56Co2RJKxujnBfnSPPbguIzTlMx2OSp1dqbk6G41v7JKFI2+c4RrHLXzFdis0RDmywYjmVizdlPpCTK/yREftwSuMIyLq2TkB937p+uwfrLZUlasNXlhoC+m3FEevQq55OlOg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733858967; c=relaxed/simple; bh=dVAsAv+pNkJJhj5C9U54H2VqdPLa4XyPOcyIeKajT+0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=hdPkrD52uTFt29VqH5DPA1DT2K630wXigqQ+CNv7lk3+QPRrP2w1d0K6Koc+1C74ASMSnkGzE1wcJWQeW6DUjOaBEIKcqDeJ0ZIhVlBJph/8G7P6yDZv2FJhv34ro6NDH5lQ5+N2e4CJ5MEsW6j0tLXm/xNYGtVUb4oezytTYlU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=P8U6DrE2; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="P8U6DrE2" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B829FC4CEE0; Tue, 10 Dec 2024 19:29:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1733858967; bh=dVAsAv+pNkJJhj5C9U54H2VqdPLa4XyPOcyIeKajT+0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=P8U6DrE24AdTfegesPNyvGul2AJ9zDQvXsK5bmQ9KiTPhCD1TcwpbyRtmsZ1UjuIU +h0myuITlYG83+PxHGLDBlkED81FK3AmNOEZYBRZivWksjkp8CJejoz0hQqI8OjLUr vzUlaNcZO2zXqA5KjV9/Ni4L112RryYnYN8U1QMfXCePE0xIKHGboWdPX/pBLzGM3Y FamHmkrFxZkUuz7vdKaZyIIraxjSpxZ0T6IAM3J5c4SfG5VsEHu8jHIR4VkjnJJ7ET 7HV2qpjIKOGmaUBf0LrFE//xdUj7JoCfdOvQsAXsDF4OZpa5D5+zxFPA6zf5oR686M LhI1D8Ib2G2/g== From: cel@kernel.org To: Cc: Anna Schumaker , Chuck Lever Subject: [PATCH 6/6] codereadyrepo: Enable codeready-builder in AWS Date: Tue, 10 Dec 2024 14:29:19 -0500 Message-ID: <20241210192920.682914-7-cel@kernel.org> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241210192920.682914-1-cel@kernel.org> References: <20241210192920.682914-1-cel@kernel.org> Precedence: bulk X-Mailing-List: kdevops@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Chuck Lever Running "make pynfs" against an AWS EC2 instance 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 might be needed for running the pynfs workflow in AWS. Similar adjustments might be necessary for other cloud providers. Signed-off-by: Chuck Lever --- .../roles/codereadyrepo/defaults/main.yml | 5 +++ playbooks/roles/codereadyrepo/tasks/main.yml | 41 +++++++++++++++---- 2 files changed, 37 insertions(+), 9 deletions(-) create mode 100644 playbooks/roles/codereadyrepo/defaults/main.yml diff --git a/playbooks/roles/codereadyrepo/defaults/main.yml b/playbooks/roles/codereadyrepo/defaults/main.yml new file mode 100644 index 000000000000..1f1f64facf90 --- /dev/null +++ b/playbooks/roles/codereadyrepo/defaults/main.yml @@ -0,0 +1,5 @@ +# SPDX-License-Identifier GPL-2.0+ +--- +# Our sensible defaults for the codereadyrepo role. + +kdevops_enable_terraform: false diff --git a/playbooks/roles/codereadyrepo/tasks/main.yml b/playbooks/roles/codereadyrepo/tasks/main.yml index 71ad05c9d539..90e0bbf3d332 100644 --- a/playbooks/roles/codereadyrepo/tasks/main.yml +++ b/playbooks/roles/codereadyrepo/tasks/main.yml @@ -1,14 +1,37 @@ --- -- 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 CodeReady repo to enable (RHEL AWS) + 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" + - ansible_distribution == "RedHat" -- name: Enable the CodeReady repo - become: yes - ansible.builtin.command: /usr/bin/dnf config-manager --enable crb +- name: Select the CodeReady repo to enable (RHEL) + ansible.builtin.set_fact: + codeready_repo: "codeready-builder-for-rhel-{{ ansible_distribution_major_version }}-{{ ansible_architecture }}-rpms" + when: + - not kdevops_enable_terraform + - ansible_distribution == "RedHat" + +- name: Select the CodeReady repo to enable (CentOS) + ansible.builtin.set_fact: + codeready_repo: "crb" + when: + - not kdevops_enable_terraform + - ansible_distribution == "CentOS" + +- name: Enable the selected CodeReady repo + become: true + become_method: ansible.builtin.sudo + ansible.builtin.command: + argv: + - "/usr/bin/dnf" + - "config-manager" + - "--enable" + - "{{ codeready_repo }}" + register: dnf_result when: - - ansible_distribution == 'CentOS' - not devconfig_custom_yum_repofile + - ansible_distribution == "RedHat" or ansible_distribution == "CentOS" + changed_when: dnf_result is success