public inbox for kdevops@lists.linux.dev
 help / color / mirror / Atom feed
From: Chuck Lever <chuck.lever@oracle.com>
To: Daniel Gomez <da.gomez@kernel.org>
Cc: Luis Chamberlain <mcgrof@kernel.org>,
	kdevops@lists.linux.dev, Daniel Gomez <da.gomez@samsung.com>
Subject: Re: [PATCH 6/8] ansible_cfg: add inventory support
Date: Thu, 1 May 2025 16:40:49 -0400	[thread overview]
Message-ID: <516ee0fd-da49-488d-8e2c-76c87cbf3fc7@oracle.com> (raw)
In-Reply-To: <o352f36ys657vntsh5pgwj4mfli3n2qkcuuhuxhf2ui4eegyb5@az3gpnk2unrg>

On 5/1/25 4:22 PM, Daniel Gomez wrote:
> On Thu, May 01, 2025 at 03:41:19PM +0100, Chuck Lever wrote:
>> On 5/1/25 2:35 PM, Daniel Gomez wrote:
>>> From: Daniel Gomez <da.gomez@samsung.com>
>>>
>>> Allow to configure the inventory file (currently via KDEVOPS_HOSTFILE
>>> and KDEVOPS_HOSTS) via ansible.cfg.
>>>
>>> The Ansible inventory file [1][2][3] is used in all kdevops/Makefile
>>> ansible-playbook calls. Enable this configuration to the global Ansible
>>> configuration file (ansible.cfg) and allow to define the inventory via
>>> Kconfig. This will simplify the playbook invocation.
>>>
>>> [1]
>>> https://docs.ansible.com/ansible/latest/reference_appendices/
>>> config.html#default-host-list
>>>
>>> [2]
>>> https://docs.ansible.com/ansible/latest/cli/
>>> ansible-inventory.html#cmdoption-ansible-inventory-i
>>>
>>> [3]
>>> https://docs.ansible.com/ansible/latest/reference_appendices/
>>> config.html#envvar-ANSIBLE_INVENTORY
>>>
>>> This has not effects yet as all ansible-playbook calls specify the
>>> --inventory/-i argument. The next commits will cleanup and allow the
>>> inventory defined in ansible.cfg to actually work.
>>>
>>> Signed-off-by: Daniel Gomez <da.gomez@samsung.com>
>>> ---
>>>  kconfigs/Kconfig.ansible_cfg                         | 5 +++++
>>>  kconfigs/Kconfig.ansible_provisioning                | 6 ------
>>>  playbooks/roles/ansible_cfg/templates/ansible.cfg.j2 | 1 +
>>>  3 files changed, 6 insertions(+), 6 deletions(-)
>>>
>>> diff --git a/kconfigs/Kconfig.ansible_cfg b/kconfigs/Kconfig.ansible_cfg
>>> index b587596bc8d5f1215fa8c006f32d941bea5288cc..05587cf31098cc5ca816d5b5fbbcdc9e8794e641 100644
>>> --- a/kconfigs/Kconfig.ansible_cfg
>>> +++ b/kconfigs/Kconfig.ansible_cfg
>>> @@ -207,6 +207,11 @@ config ANSIBLE_CFG_FORKS
>>>  
>>>  endif # !ANSIBLE_CFG_FORKS_CUSTOM
>>>  
>>> +config ANSIBLE_CFG_INVENTORY
>>> +	string "Ansible Inventory"
>>
>> Perhaps "Pathname to Ansible hosts inventory file" might be more clear.
> 
> The configuartion exposes path + file. The string output will be mapped to:
> 
> 	Section:
> 	[defaults]
> 	Key:
> 	inventory
> 
> What do you think of re-using the Ansible description of DEFAULT_HOST_LIST [1]?
> 
> "Comma-separated list of Ansible inventory sources"
> 
> Or perhaps just "Ansible inventory sources"?
> 
> [1]
> https://docs.ansible.com/ansible/latest/reference_appendices/config.html#default-host-list

For the short help string, "Ansible inventory sources" is concise.

But the help text should explain that this is a list of pathnames, or
something more explicit, IMHO. It might even provide an example.

(In general, I find I will lean on Kconfig help first before diving into
the docs/ directory, so having beefy help text right here would be
awesome.)


>>> +	output yaml
>>> +	default "$(TOPDIR_PATH)/hosts"
>>
>> I've never had need to adjust this pathname. It would be great to
>> include a help section here that explains why changing this pathname
>> might be necessary.
> 
> Users can now use as many inventories (including path) as needed. What I had
> in mind was the 'sandbox' support I sent a few months ago. This enables the
> path towards having one kdevops repo and different sandboxes, where each sandbox
> allows the user to run different kdevops configurations. I'll include a
> description with this suggestion.

That helps! Sandboxing sounds useful, I do something like that with
buildbot that could be easily replaced.

-- 
Chuck Lever

  reply	other threads:[~2025-05-01 20:40 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-01 18:35 [PATCH 0/8] Define Ansible inventory in the Ansible Configuration file Daniel Gomez
2025-05-01 18:35 ` [PATCH 1/8] playbooks: fix playbook name for all hosts plays Daniel Gomez
2025-05-01 18:35 ` [PATCH 2/8] playbooks: fix playbook name for localhost plays Daniel Gomez
2025-05-01 18:35 ` [PATCH 3/8] Makefile: use long form of limit argument for clarity Daniel Gomez
2025-05-01 18:35 ` [PATCH 4/8] Makefile: print target when debug Daniel Gomez
2025-05-01 18:35 ` [PATCH 5/8] .github/workflows/fstests.yml: enable make verbosity Daniel Gomez
2025-05-01 18:35 ` [PATCH 6/8] ansible_cfg: add inventory support Daniel Gomez
2025-05-01 19:41   ` Chuck Lever
2025-05-01 20:22     ` Daniel Gomez
2025-05-01 20:40       ` Chuck Lever [this message]
2025-05-01 21:50         ` Daniel Gomez
2025-05-01 18:35 ` [PATCH 7/8] gen_hosts: templates: add localhost to all hosts Daniel Gomez
2025-05-01 18:35 ` [PATCH 8/8] Makefile: use inventory from ansible.cfg Daniel Gomez
2025-05-02 16:34 ` [PATCH 0/8] Define Ansible inventory in the Ansible Configuration file Luis Chamberlain
2025-05-02 19:27   ` Daniel Gomez
2025-05-02 22:43     ` Luis Chamberlain
2025-05-02 22:45       ` Luis Chamberlain
2025-05-03 18:52         ` Daniel Gomez
2025-05-03 18:17       ` Daniel Gomez
2025-05-03 18:58         ` Luis Chamberlain

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=516ee0fd-da49-488d-8e2c-76c87cbf3fc7@oracle.com \
    --to=chuck.lever@oracle.com \
    --cc=da.gomez@kernel.org \
    --cc=da.gomez@samsung.com \
    --cc=kdevops@lists.linux.dev \
    --cc=mcgrof@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox