Re: [PATCH] devconfig: add a default for kdevops_enable_terraform
Daniel Gomez <[email protected]> Thu, 25 Sep 2025 16:49:16 +0200
| Newsgroups | dev.linux.lists.kdevops |
|---|---|
| Organization | kernel.org |
| Message-ID | <[email protected]> |
On 25/09/2025 16.33, Chuck Lever wrote:
> On 9/25/25 7:29 AM, Daniel Gomez wrote:
>> On 24/09/2025 22.14, Jeff Layton wrote:
>>> On Wed, 2025-09-24 at 15:57 -0400, Chuck Lever wrote:
>>>> On 9/24/25 12:55 PM, Jeff Layton wrote:
>>>>> On Wed, 2025-09-24 at 15:48 -0400, Chuck Lever wrote:
>>>>>> On 9/24/25 12:42 PM, Jeff Layton wrote:
>>>>>>> Fixes: 7710a1e2e820 ("devconfig: Remove "dnf update" optimizations for terraform hosts")
>>>>>>> Signed-off-by: Jeff Layton <[email protected]>
>>>>>>> ---
>>>>>>> playbooks/roles/devconfig/defaults/main.yml | 1 +
>>>>>>> 1 file changed, 1 insertion(+)
>>>>>>>
>>>>>>> diff --git a/playbooks/roles/devconfig/defaults/main.yml b/playbooks/roles/devconfig/defaults/main.yml
>>>>>>> index c5c06e01b06d..b5d4724d37ef 100644
>>>>>>> --- a/playbooks/roles/devconfig/defaults/main.yml
>>>>>>> +++ b/playbooks/roles/devconfig/defaults/main.yml
>>>>>>> @@ -59,3 +59,4 @@ distro_debian_has_hop1_sources: false
>>>>>>> unattended_upgrades_installed: false
>>>>>>> workflow_infer_user_and_group: false
>>>>>>> kdevops_use_declared_hosts: false
>>>>>>> +kdevops_enable_terraform: false
>>>>>>
>>>>>> Yeah. "output yaml" doesn't work the way I expect. <sheesh>
>>>>>>
>>>>>
>>>>> The way these defaults get set seems very random and fragmented to me.
>>>>>
>>>>> Can I take your "Yeah" as a R-b?
>>>>
>>>> I didn't give a full-throated R-b because I'm wondering if there's
>>>> a better way to approach this general problem.
>>>>
>>>
>>> That's the way I feel too. I don't get the logic of when to set
>>> variables in a limited way like this and when to do it more globally.
>>> For now, this at least gets things running again for me.
>>>
>>>> But OK:
>>>>
>>>> Reviewed-by: Chuck Lever <[email protected]>
>>>>
>>>
>>> Thanks!
>>
>> What are we fixing exactly? What does it mean "output yaml" doesn't work as
>> expected?
>>
>> I assume Ansible complains about kdevops_enable_terraform not being defined.
>> In that case, if we have kconfig yaml output, the devconfig playbook should
>> parse it via .extra_vars_auto.yaml. Note that the extra_vars.yaml way with
>> *_EXTRA_VARS should be removed at some point to make things easier. At this
>> point we are supporting multiple ways to share variables from Kconfig -> Ansible
>> and we don't want that.
>>
>> But i don't see Kconfig support for this variable...
>>
>> git grep -i kdevops_enable_terraform
>> playbooks/roles/codereadyrepo/defaults/main.yml:kdevops_enable_terraform: false
>> playbooks/roles/codereadyrepo/tasks/main.yml: - kdevops_enable_terraform
>> playbooks/roles/codereadyrepo/tasks/main.yml: - kdevops_enable_terraform
>> playbooks/roles/codereadyrepo/tasks/main.yml: - kdevops_enable_terraform
>> playbooks/roles/create_data_partition/defaults/main.yml:kdevops_enable_terraform: false
>> playbooks/roles/create_data_partition/tasks/main.yml: - kdevops_enable_terraform|bool
>> playbooks/roles/devconfig/tasks/install-deps/redhat/main.yml: - not kdevops_enable_terraform|bool
>> playbooks/roles/devconfig/tasks/install-deps/redhat/main.yml: - not kdevops_enable_terraform|bool
>> playbooks/roles/gen_nodes/defaults/main.yml:kdevops_enable_terraform: false
>> playbooks/roles/gen_tfvars/tasks/main.yml: - kdevops_enable_terraform
>> playbooks/roles/volume_group/defaults/main.yml:kdevops_enable_terraform: false
>> playbooks/roles/volume_group/tasks/main.yml: - kdevops_enable_terraform|bool
>> scripts/terraform.Makefile:TERRAFORM_EXTRA_VARS += kdevops_enable_terraform='True'
>
> My bad. I thought I remembered there was an "output yaml" for this
> variable; but no, it's set as an EXTRA VAR.
>
> And I see that codereadyrepo handles the default value just as Jeff's
> patch does it.
>
> So, I take back my cursing. Jeff's fix is correct as it stands.
>
>
No problem. FWIW, I've been thinking about this cleanup for a while [1].
What I think it may work best is:
Kconfig -> .config -> Makefile (I believe there are some variables we use not only for Ansible)
-> vars.yaml -> Ansible
But this is another topic.
The correct way would be to add this variable in Kconfig and get it right
away in Ansible with output yaml. If we want playbooks to be reusable outside
kdevops, all these default playbook variables are anyway needed.
Link: https://lore.kernel.org/kdevops/c7h4w4jwtrf5q3h77tcxsgpiq7x3ij6zcu5qtmf3akyvntuenb@cesvkshy7xvt/ [1]