public inbox for kdevops@lists.linux.dev
 help / color / mirror / Atom feed
* [PATCH] pynfs: Enable codeready-builder in AWS
@ 2024-10-18 21:44 cel
  2024-10-18 22:14 ` Scott Mayhew
  2024-10-19 10:38 ` Scott Mayhew
  0 siblings, 2 replies; 6+ messages in thread
From: cel @ 2024-10-18 21:44 UTC (permalink / raw)
  To: kdevops; +Cc: Chuck Lever

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

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 <chuck.lever@oracle.com>
---
 .../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"
+
+- 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 }}"
 
 - 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


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] pynfs: Enable codeready-builder in AWS
  2024-10-18 21:44 [PATCH] pynfs: Enable codeready-builder in AWS cel
@ 2024-10-18 22:14 ` Scott Mayhew
  2024-10-19 10:38 ` Scott Mayhew
  1 sibling, 0 replies; 6+ messages in thread
From: Scott Mayhew @ 2024-10-18 22:14 UTC (permalink / raw)
  To: cel; +Cc: kdevops, Chuck Lever

On Fri, 18 Oct 2024, cel@kernel.org wrote:

> From: Chuck Lever <chuck.lever@oracle.com>
> 
> 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 <chuck.lever@oracle.com>
> ---
>  .../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

Probably should remove the debugging stuff before merging.
> +
> +- 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"
> +
> +- 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 }}"

I'm not sure if this will work on my setups.  I use
devconfig_custom_yum_repofile in lieu of registering my systems because
I'm usually testing bits that aren't in any official repos yet.

So nfsd_codeready_repo will be unset when it gets to this command and
it'll just run 'dnf config-manager --enable'.

>  
>  - 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
> 
> 


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] pynfs: Enable codeready-builder in AWS
  2024-10-18 21:44 [PATCH] pynfs: Enable codeready-builder in AWS cel
  2024-10-18 22:14 ` Scott Mayhew
@ 2024-10-19 10:38 ` Scott Mayhew
  2024-10-19 18:47   ` Chuck Lever III
  1 sibling, 1 reply; 6+ messages in thread
From: Scott Mayhew @ 2024-10-19 10:38 UTC (permalink / raw)
  To: cel; +Cc: kdevops, Chuck Lever

[-- Attachment #1: Type: text/plain, Size: 4875 bytes --]

On Fri, 18 Oct 2024, cel@kernel.org wrote:

> From: Chuck Lever <chuck.lever@oracle.com>
> 
> 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 <chuck.lever@oracle.com>
> ---
>  .../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
> 
> 

[-- Attachment #2: fixup.patch --]
[-- Type: text/plain, Size: 888 bytes --]

diff --git a/playbooks/roles/pynfs/defaults/main.yml b/playbooks/roles/pynfs/defaults/main.yml
index de09583..67ecd84 100644
--- a/playbooks/roles/pynfs/defaults/main.yml
+++ b/playbooks/roles/pynfs/defaults/main.yml
@@ -5,5 +5,6 @@
 # We default to not run tests.
 kdevops_run_pynfs: False
 pynfs_pnfs_block: False
+kdevops_enable_terraform: False
 
 pynfs_data: "{{ data_path }}/pynfs"
diff --git a/playbooks/roles/pynfs/tasks/install-deps/redhat/main.yml b/playbooks/roles/pynfs/tasks/install-deps/redhat/main.yml
index 5f377ee..0211072 100644
--- a/playbooks/roles/pynfs/tasks/install-deps/redhat/main.yml
+++ b/playbooks/roles/pynfs/tasks/install-deps/redhat/main.yml
@@ -36,6 +36,8 @@
       - "config-manager"
       - "--enable"
       - "{{ nfsd_codeready_repo }}"
+  when:
+    - not devconfig_custom_yum_repofile
 
 - name: Install build dependencies for pynfs
   become: true

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] pynfs: Enable codeready-builder in AWS
  2024-10-19 10:38 ` Scott Mayhew
@ 2024-10-19 18:47   ` Chuck Lever III
  2024-10-19 19:17     ` Chuck Lever III
  0 siblings, 1 reply; 6+ messages in thread
From: Chuck Lever III @ 2024-10-19 18:47 UTC (permalink / raw)
  To: Scott Mayhew; +Cc: Chuck Lever, kdevops@lists.linux.dev



> On Oct 19, 2024, at 6:38 AM, Scott Mayhew <smayhew@redhat.com> wrote:
> 
> On Fri, 18 Oct 2024, cel@kernel.org wrote:
> 
>> From: Chuck Lever <chuck.lever@oracle.com>
>> 
>> 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 <chuck.lever@oracle.com>
>> ---
>> .../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.
> 

I tested this patch with libvirt, didn't see that problem,
though I did expect to.


>> +
>> +- 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
>> 
>> 
> <fixup.patch>

Agreed, this patch needs more work. I thought I had tagged
it with "RFC" before sending, but I guess I didn't actually
do that.


--
Chuck Lever



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] pynfs: Enable codeready-builder in AWS
  2024-10-19 18:47   ` Chuck Lever III
@ 2024-10-19 19:17     ` Chuck Lever III
  2024-11-10 16:50       ` Chuck Lever III
  0 siblings, 1 reply; 6+ messages in thread
From: Chuck Lever III @ 2024-10-19 19:17 UTC (permalink / raw)
  To: Scott Mayhew; +Cc: Chuck Lever, kdevops@lists.linux.dev



> On Oct 19, 2024, at 2:47 PM, Chuck Lever III <chuck.lever@oracle.com> wrote:
> 
> 
> 
>> On Oct 19, 2024, at 6:38 AM, Scott Mayhew <smayhew@redhat.com> wrote:
>> 
>> On Fri, 18 Oct 2024, cel@kernel.org wrote:
>> 
>>> From: Chuck Lever <chuck.lever@oracle.com>
>>> 
>>> 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 <chuck.lever@oracle.com>
>>> ---
>>> .../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.
>> 
> 
> I tested this patch with libvirt, didn't see that problem,
> though I did expect to.

I think setting a default in pynfs/defaults/main.yml
will make that variable always be false in
pynfs/tasks/main.yml -- that default would likely
"cover" the global version of that variable.

playbooks/roles/gen_nodes/defaults/main.yml has this:

kdevops_enable_guestfs: False
kdevops_enable_terraform: False
kdevops_enable_vagrant: False
kdevops_enable_iscsi: false

This works for guestfs, vagrant, and iscsi, so I don't
understand why terraform would be undefined.

--
Chuck Lever



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] pynfs: Enable codeready-builder in AWS
  2024-10-19 19:17     ` Chuck Lever III
@ 2024-11-10 16:50       ` Chuck Lever III
  0 siblings, 0 replies; 6+ messages in thread
From: Chuck Lever III @ 2024-11-10 16:50 UTC (permalink / raw)
  To: Scott Mayhew; +Cc: Chuck Lever, kdevops@lists.linux.dev



> On Oct 19, 2024, at 3:17 PM, Chuck Lever III <chuck.lever@oracle.com> wrote:
> 
> 
> 
>> On Oct 19, 2024, at 2:47 PM, Chuck Lever III <chuck.lever@oracle.com> wrote:
>> 
>> 
>> 
>>> On Oct 19, 2024, at 6:38 AM, Scott Mayhew <smayhew@redhat.com> wrote:
>>> 
>>> On Fri, 18 Oct 2024, cel@kernel.org wrote:
>>> 
>>>> From: Chuck Lever <chuck.lever@oracle.com>
>>>> 
>>>> 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 <chuck.lever@oracle.com>
>>>> ---
>>>> .../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.
>>> 
>> 
>> I tested this patch with libvirt, didn't see that problem,
>> though I did expect to.
> 
> I think setting a default in pynfs/defaults/main.yml
> will make that variable always be false in
> pynfs/tasks/main.yml -- that default would likely
> "cover" the global version of that variable.
> 
> playbooks/roles/gen_nodes/defaults/main.yml has this:
> 
> kdevops_enable_guestfs: False
> kdevops_enable_terraform: False
> kdevops_enable_vagrant: False
> kdevops_enable_iscsi: false
> 
> This works for guestfs, vagrant, and iscsi, so I don't
> understand why terraform would be undefined.

Adding the default setting as your patch did seems
to work fine, so I went with that.

However, it looks like there are a couple of other
codereadybuilder consumers in kdevops, and they
have the same problem as pynfs when running on
AWS.

My inclination is to extract the Ansible logic
that installs CRB into a separate role that
handles the AWS case properly.


--
Chuck Lever



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-11-10 16:50 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-18 21:44 [PATCH] pynfs: Enable codeready-builder in AWS cel
2024-10-18 22:14 ` Scott Mayhew
2024-10-19 10:38 ` Scott Mayhew
2024-10-19 18:47   ` Chuck Lever III
2024-10-19 19:17     ` Chuck Lever III
2024-11-10 16:50       ` Chuck Lever III

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox