On Fri, 18 Oct 2024, cel@kernel.org wrote: > 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 > playbooks/roles/pynfs/tasks/install-deps/redhat/main.yml to try > to sketch in what we might need for running the pynfs in the > cloud. > > Signed-off-by: Chuck Lever > --- > .../pynfs/tasks/install-deps/redhat/main.yml | 51 ++++++++++++++----- > 1 file changed, 38 insertions(+), 13 deletions(-) > > diff --git a/playbooks/roles/pynfs/tasks/install-deps/redhat/main.yml b/playbooks/roles/pynfs/tasks/install-deps/redhat/main.yml > index f4aee14c5430..5f377eed436f 100644 > --- a/playbooks/roles/pynfs/tasks/install-deps/redhat/main.yml > +++ b/playbooks/roles/pynfs/tasks/install-deps/redhat/main.yml > @@ -1,24 +1,49 @@ > --- > -- 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 > +# name: Display all variables > +# debug: > +# var=vars > + > +- name: Select the CodeReady repo to enable > + ansible.builtin.set_fact: > + nfsd_codeready_repo: "codeready-builder-for-rhel-{{ ansible_distribution_major_version }}-rhui-rpms" > when: > - - ansible_distribution == 'RedHat' > + - kdevops_enable_terraform > + - kdevops_terraform_provider == "aws" > + - ansible_distribution == "RedHat" When I tested your patch I got: ---8<--- TASK [pynfs : Select the CodeReady repo to enable] ******************************************************************************************************************************************************************************************* fatal: [kdevops-pynfs-rhel-9-kotd-nfsd]: FAILED! => {} MSG: The conditional check 'kdevops_enable_terraform' failed. The error was: error while evaluating conditional (kdevops_enable_terraform): 'kdevops_enable_terraform' is undefined. 'kdevops_enable_terraform' is undefined The error appears to be in '/home/buildbot/git/kdevops-pynfs-rhel-9-kotd/playbooks/roles/pynfs/tasks/install-deps/redhat/main.yml': line 6, column 3, but may be elsewhere in the file depending on the exact syntax problem. The offending line appears to be: - name: Select the CodeReady repo to enable ^ here ---8<--- So I added "kdevops_enable_terraform: False" to playbooks/roles/pynfs/defaults/main.yml. > + > +- name: Select the CodeReady repo to enable > + ansible.builtin.set_fact: > + nfsd_codeready_repo: "codeready-builder-for-rhel-{{ ansible_distribution_major_version }}-{{ ansible_architecture }}-rpms" > + when: > + - not kdevops_enable_terraform > + - ansible_distribution == "RedHat" > + - not devconfig_custom_yum_repofile > + > +- name: Select the CodeReady repo to enable > + ansible.builtin.set_fact: > + nfsd_codeready_repo: "crb" > + when: > + - not kdevops_enable_terraform > + - ansible_distribution == "CentOS" > - 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 > + become: true > + become_method: ansible.builtin.sudo > + ansible.builtin.command: > + argv: > + - "/usr/bin/dnf" > + - "config-manager" > + - "--enable" > + - "{{ nfsd_codeready_repo }}" And then here (I thought I sent an email about this last night but I can't find it in my sent folder): ---8<--- TASK [pynfs : Enable the CodeReady repo] ***************************************************************************************************************************************************************************************************** fatal: [kdevops-pynfs-rhel-9-kotd-nfsd]: FAILED! => {} MSG: The task includes an option with an undefined variable. The error was: 'nfsd_codeready_repo' is undefined. 'nfsd_codeready_repo' is undefined The error appears to be in '/home/buildbot/git/kdevops-pynfs-rhel-9-kotd/playbooks/roles/pynfs/tasks/install-deps/redhat/main.yml': line 30, column 3, but may be elsewhere in the file depending on the exact syntax problem. The offending line appears to be: - name: Enable the CodeReady repo ^ here ---8<--- This task needs when clause: when: - not devconfig_custom_yum_repofile -Scott > > - name: Install build dependencies for pynfs > - become: yes > - become_method: sudo > - yum: > - update_cache: yes > + become: true > + become_method: ansible.builtin.sudo > + ansible.builtin.yum: > + update_cache: true > name: "{{ packages }}" > + state: present > retries: 3 > delay: 5 > register: result > -- > 2.46.1 > >