* [PATCH 0/8] Define Ansible inventory in the Ansible Configuration file
@ 2025-05-01 18:35 Daniel Gomez
2025-05-01 18:35 ` [PATCH 1/8] playbooks: fix playbook name for all hosts plays Daniel Gomez
` (8 more replies)
0 siblings, 9 replies; 20+ messages in thread
From: Daniel Gomez @ 2025-05-01 18:35 UTC (permalink / raw)
To: Luis Chamberlain, Chuck Lever; +Cc: kdevops, Daniel Gomez, Daniel Gomez
This promotes the Ansible inventory file (typically 'hosts' in kdevops)
to the Ansible Configuration file (ansible.cfg). By doing this, we allow
to control the hosts globally rather than in all the ansible-playbook
commands, as well as clean up the ansible-playbook command.
So, we don't need to define anymore the inventory file in the command.
However, playbooks may still be controlled on which targets the playbook
is run. This is done through the playbook itself and/or through the
ansible-playbook argument --limit.
As part of the series, the term 'all' to refer to all hosts is redefined
to include the localhost. This removes the need to be explicit with
localhost playbooks runs, as it's now just another target in the
inventory file. This term redefinition requires to change playbooks that
use the term all, either through ansible-playbook command or through the
host: field in the YAML playbook file. For this reason, the term has
been replaced in most cases with 'all:!localhost', which means all
targets in the inventory file except the localhost. Except the
bootlinux.yml playbook, all playbooks run either on localhost or remote
targets (the previous all definition). Therefore, all playbooks have
been converted to use 'hosts: all!localhost'. For the bootlinux.yml
playbook, all is kept and the control of host execution is done via
the --limit argument. It was found that only the linux-clone-9p target
runs the bootlinux playbook in the localhost while the rest of linux-*
targets run the playbook in all the remotes (all:!localhosts).
In addition, in order to help me debug this change, I found it
convenient to print the Makefile target name being run before the
command. This allows to be more explicit in verbose mode (V=1) when a
playbook is run (or any subsequent command in the target). And makes it
easier to discover which target the ansible-playbook command belongs to
when debugging playbook execution. To clarify, V=1 already prints the
command but not the Makefile target. The command output behaviour will
be a bit different as it is today as the command itself will be printed
in one line, instead of multiple.
Series has been tested here:
https://github.com/linux-kdevops/kdevops/actions/runs/14773869477
Signed-off-by: Daniel Gomez <da.gomez@samsung.com>
---
Daniel Gomez (8):
playbooks: fix playbook name for all hosts plays
playbooks: fix playbook name for localhost plays
Makefile: use long form of limit argument for clarity
Makefile: print target when debug
.github/workflows/fstests.yml: enable make verbosity
ansible_cfg: add inventory support
gen_hosts: templates: add localhost to all hosts
Makefile: use inventory from ansible.cfg
.github/workflows/fstests.yml | 16 +++---
Makefile | 27 +++++-----
Makefile.btrfs_progs | 4 +-
Makefile.build_qemu | 12 ++---
Makefile.hypervisor-tunings | 3 +-
Makefile.kdevops | 19 +++----
Makefile.linux-mirror | 6 +--
Makefile.postfix | 3 +-
kconfigs/Kconfig.ansible_cfg | 5 ++
kconfigs/Kconfig.ansible_provisioning | 6 ---
playbooks/blktests.yml | 3 +-
playbooks/bootlinux-local.yml | 3 +-
playbooks/bootlinux.yml | 3 +-
playbooks/bringup_guestfs.yml | 3 +-
playbooks/build_qemu.yml | 3 +-
playbooks/common.yml | 3 +-
playbooks/create_data_partition.yml | 3 +-
playbooks/cxl.yml | 3 +-
playbooks/devconfig.yml | 3 +-
playbooks/fstests.yml | 5 +-
playbooks/gen-pci-kconfig.yml | 3 +-
playbooks/gen_hosts.yml | 3 +-
playbooks/gen_nodes.yml | 3 +-
playbooks/gen_tfvars.yml | 3 +-
playbooks/gitr.yml | 3 +-
playbooks/hypervisor-tuning.yml | 3 +-
playbooks/install-menuconfig-deps.yml | 3 +-
playbooks/install_systemd_journal_remote.yml | 3 +-
playbooks/install_systemd_timesyncd.yml | 3 +-
playbooks/install_terraform.yml | 3 +-
playbooks/install_vagrant_boxes.yml | 3 +-
playbooks/iscsi.yml | 3 +-
playbooks/kdc.yml | 3 +-
playbooks/kdevops_archive.yml | 3 +-
playbooks/krb5.yml | 3 +-
playbooks/ktls.yml | 3 +-
playbooks/libvirt_pcie_passthrough.yml | 3 +-
playbooks/libvirt_storage_pool_create.yml | 3 +-
playbooks/libvirt_user.yml | 3 +-
playbooks/linux-mirror.yml | 3 +-
playbooks/ltp.yml | 3 +-
playbooks/nfsd.yml | 3 +-
playbooks/nfstest.yml | 3 +-
playbooks/pkg.yml | 3 +-
playbooks/postfix_relay_host.yml | 3 +-
playbooks/pynfs.yml | 3 +-
playbooks/reboot-limit.yml | 3 +-
.../roles/ansible_cfg/templates/ansible.cfg.j2 | 1 +
playbooks/roles/gen_hosts/defaults/main.yml | 1 -
playbooks/roles/gen_hosts/tasks/main.yml | 52 +++++++++---------
playbooks/roles/gen_hosts/templates/blktests.j2 | 1 +
playbooks/roles/gen_hosts/templates/cxl.j2 | 1 +
playbooks/roles/gen_hosts/templates/fstests.j2 | 1 +
playbooks/roles/gen_hosts/templates/gitr.j2 | 1 +
playbooks/roles/gen_hosts/templates/hosts.j2 | 2 +
playbooks/roles/gen_hosts/templates/ltp.j2 | 1 +
playbooks/roles/gen_hosts/templates/nfstest.j2 | 1 +
playbooks/roles/gen_hosts/templates/pynfs.j2 | 1 +
playbooks/roles/gen_hosts/templates/selftests.j2 | 1 +
playbooks/roles/gen_hosts/templates/sysbench.j2 | 1 +
playbooks/roles/update_etc_hosts/tasks/main.yml | 2 +-
playbooks/rxe.yml | 3 +-
playbooks/selftests.yml | 3 +-
playbooks/siw.yml | 3 +-
playbooks/smbd.yml | 3 +-
playbooks/sysbench.yml | 3 +-
playbooks/terraform.yml | 3 +-
playbooks/update_etc_hosts.yml | 3 +-
playbooks/update_ssh_config_guestfs.yml | 3 +-
playbooks/update_ssh_config_vagrant.yml | 3 +-
scripts/archive.Makefile | 3 +-
scripts/devconfig.Makefile | 8 +--
scripts/dynamic-pci-kconfig.Makefile | 3 +-
scripts/firstconfig.Makefile | 5 +-
scripts/gen-hosts.Makefile | 1 -
scripts/guestfs.Makefile | 17 +++---
scripts/install-menuconfig-deps.Makefile | 3 +-
scripts/iscsi.Makefile | 2 +-
scripts/journal-server.Makefile | 23 ++++----
scripts/kotd.Makefile | 16 +++---
scripts/krb5.Makefile | 4 +-
scripts/ktls.Makefile | 1 -
scripts/nfsd.Makefile | 2 +-
scripts/provision.Makefile | 5 +-
scripts/rdma.Makefile | 2 -
scripts/smbd.Makefile | 2 +-
scripts/systemd-timesync.Makefile | 8 +--
scripts/terraform.Makefile | 6 +--
scripts/update_etc_hosts.Makefile | 2 +-
scripts/vagrant.Makefile | 10 ++--
scripts/workflows/lib/crash.py | 4 +-
workflows/blktests/Makefile | 20 ++++---
workflows/common/Makefile | 2 +-
workflows/cxl/Makefile | 14 ++---
workflows/demos/reboot-limit/Makefile | 32 ++++++++----
workflows/fstests/Makefile | 40 ++++++++------
workflows/gitr/Makefile | 8 +--
workflows/linux/Makefile | 61 ++++++++++++++--------
workflows/ltp/Makefile | 8 +--
workflows/nfstest/Makefile | 8 +--
workflows/pynfs/Makefile | 12 ++---
workflows/selftests/Makefile | 11 ++--
workflows/sysbench/Makefile | 12 ++---
103 files changed, 370 insertions(+), 293 deletions(-)
---
base-commit: 1e8f65cd4c4385e47c04356b701c101bd519adf2
change-id: 20250430-ansible_cfg_inventory-7955944ce8ff
Best regards,
--
Daniel Gomez <da.gomez@samsung.com>
^ permalink raw reply [flat|nested] 20+ messages in thread
* [PATCH 1/8] playbooks: fix playbook name for all hosts plays
2025-05-01 18:35 [PATCH 0/8] Define Ansible inventory in the Ansible Configuration file Daniel Gomez
@ 2025-05-01 18:35 ` Daniel Gomez
2025-05-01 18:35 ` [PATCH 2/8] playbooks: fix playbook name for localhost plays Daniel Gomez
` (7 subsequent siblings)
8 siblings, 0 replies; 20+ messages in thread
From: Daniel Gomez @ 2025-05-01 18:35 UTC (permalink / raw)
To: Luis Chamberlain, Chuck Lever; +Cc: kdevops, Daniel Gomez, Daniel Gomez
From: Daniel Gomez <da.gomez@samsung.com>
Fix name rule by naming all the playbooks that run in all hosts.
https://ansible.readthedocs.io/projects/lint/rules/name/
Signed-off-by: Daniel Gomez <da.gomez@samsung.com>
---
playbooks/blktests.yml | 3 ++-
playbooks/bootlinux.yml | 3 ++-
playbooks/common.yml | 3 ++-
playbooks/create_data_partition.yml | 3 ++-
playbooks/cxl.yml | 3 ++-
playbooks/devconfig.yml | 3 ++-
playbooks/gitr.yml | 3 ++-
playbooks/iscsi.yml | 3 ++-
playbooks/kdc.yml | 3 ++-
playbooks/krb5.yml | 3 ++-
playbooks/ktls.yml | 3 ++-
playbooks/ltp.yml | 3 ++-
playbooks/nfsd.yml | 3 ++-
playbooks/nfstest.yml | 3 ++-
playbooks/pkg.yml | 3 ++-
playbooks/pynfs.yml | 3 ++-
playbooks/reboot-limit.yml | 3 ++-
playbooks/rxe.yml | 3 ++-
playbooks/selftests.yml | 3 ++-
playbooks/siw.yml | 3 ++-
playbooks/smbd.yml | 3 ++-
playbooks/sysbench.yml | 3 ++-
playbooks/terraform.yml | 3 ++-
playbooks/update_etc_hosts.yml | 3 ++-
24 files changed, 48 insertions(+), 24 deletions(-)
diff --git a/playbooks/blktests.yml b/playbooks/blktests.yml
index 99732af2b681d5a8a161514513e564495a2686c9..91b484fbef5f8868b97fff337eaf5011e4c7f9f6 100644
--- a/playbooks/blktests.yml
+++ b/playbooks/blktests.yml
@@ -1,4 +1,5 @@
---
-- hosts: all
+- name: blktests
+ hosts: all
roles:
- role: blktests
diff --git a/playbooks/bootlinux.yml b/playbooks/bootlinux.yml
index 418bbed4c060ed10333f2b1c5832f4217d18f458..676469d49348ad209bb2d094b86e088a4dcf03b0 100644
--- a/playbooks/bootlinux.yml
+++ b/playbooks/bootlinux.yml
@@ -1,4 +1,5 @@
---
-- hosts: all
+- name: bootlinux
+ hosts: all
roles:
- role: bootlinux
diff --git a/playbooks/common.yml b/playbooks/common.yml
index 48485e3cfad5a253bd87ef231463167a824076f8..c4f0102b4bd5729d9ae347ae5c80a0a04576312e 100644
--- a/playbooks/common.yml
+++ b/playbooks/common.yml
@@ -1,4 +1,5 @@
---
-- hosts: all
+- name: common
+ hosts: all
roles:
- role: common
diff --git a/playbooks/create_data_partition.yml b/playbooks/create_data_partition.yml
index fe7890b357c1ec0a4e42f29c24d2fbf093868fda..9cf4d0506c830847d54aa02555e0cc705b031cb3 100644
--- a/playbooks/create_data_partition.yml
+++ b/playbooks/create_data_partition.yml
@@ -1,4 +1,5 @@
---
-- hosts: all
+- name: create_data_partition
+ hosts: all
roles:
- role: create_data_partition
diff --git a/playbooks/cxl.yml b/playbooks/cxl.yml
index 87638599bf4397c9508f7c746316e0f2e9312f67..65277d435a6fe13661febfea78181bf3a13e4dfc 100644
--- a/playbooks/cxl.yml
+++ b/playbooks/cxl.yml
@@ -1,4 +1,5 @@
---
-- hosts: all
+- name: cxl
+ hosts: all
roles:
- role: cxl
diff --git a/playbooks/devconfig.yml b/playbooks/devconfig.yml
index 871651d740153d5ed0f75d466da5ca218362425e..45eb163bedd95c9cb8736f3cb68954df6dacf941 100644
--- a/playbooks/devconfig.yml
+++ b/playbooks/devconfig.yml
@@ -1,5 +1,6 @@
---
-- hosts: all
+- name: devconfig
+ hosts: all
gather_facts: no
roles:
- role: devconfig
diff --git a/playbooks/gitr.yml b/playbooks/gitr.yml
index 4c3e3ba919d767c897f79e30debd628737f89a82..5037a813f6b0a759bede52d7092af2bff218315b 100644
--- a/playbooks/gitr.yml
+++ b/playbooks/gitr.yml
@@ -1,4 +1,5 @@
---
-- hosts: all
+- name: gitr
+ hosts: all
roles:
- role: gitr
diff --git a/playbooks/iscsi.yml b/playbooks/iscsi.yml
index cea400081c8dbc9558d88bebe649407f1b9b235e..5b3c4f356d8864761e5d768c81d740180a20740c 100644
--- a/playbooks/iscsi.yml
+++ b/playbooks/iscsi.yml
@@ -1,4 +1,5 @@
---
-- hosts: all
+- name: iscsi
+ hosts: all
roles:
- role: iscsi
diff --git a/playbooks/kdc.yml b/playbooks/kdc.yml
index 66709db81d531e373f2e51770f1bee70b091d6f5..27de7faf436dd3061fbe20c22bac5f0131a21356 100644
--- a/playbooks/kdc.yml
+++ b/playbooks/kdc.yml
@@ -1,4 +1,5 @@
---
-- hosts: all
+- name: kdc
+ hosts: all
roles:
- role: kdc
diff --git a/playbooks/krb5.yml b/playbooks/krb5.yml
index 52ca3ef5aef4ab08bd05f1c3fc8d01c7a653af32..8d65e560dab24b1a8f1457334c5a426dc40108c9 100644
--- a/playbooks/krb5.yml
+++ b/playbooks/krb5.yml
@@ -1,4 +1,5 @@
---
-- hosts: all
+- name: krb5
+ hosts: all
roles:
- role: krb5
diff --git a/playbooks/ktls.yml b/playbooks/ktls.yml
index 8b7044c7ef2d26819333de2e0bd2f4dd6b00f688..70cc9c0c8fc3090083e4487298096252ebd5d7aa 100644
--- a/playbooks/ktls.yml
+++ b/playbooks/ktls.yml
@@ -1,4 +1,5 @@
---
-- hosts: all
+- name: ktls
+ hosts: all
roles:
- role: ktls
diff --git a/playbooks/ltp.yml b/playbooks/ltp.yml
index 5921cefc76e4d4369e858709aeeb58878a101195..c01022f5f765b7e084c3806acd3d9ce249e445d6 100644
--- a/playbooks/ltp.yml
+++ b/playbooks/ltp.yml
@@ -1,4 +1,5 @@
---
-- hosts: all
+- name: ltp
+ hosts: all
roles:
- role: ltp
diff --git a/playbooks/nfsd.yml b/playbooks/nfsd.yml
index 6c7735867eec9c570875dc02192e9494d811d364..edb8b1ff8de9eaf91cceedab7fe0a4672b1d7148 100644
--- a/playbooks/nfsd.yml
+++ b/playbooks/nfsd.yml
@@ -1,4 +1,5 @@
---
-- hosts: all
+- name: nfsd
+ hosts: all
roles:
- role: nfsd
diff --git a/playbooks/nfstest.yml b/playbooks/nfstest.yml
index d414091aee7c24662a9e128d88da0b184697b9bf..03715ebf45f90070ba1d57feab27720f23d28d5e 100644
--- a/playbooks/nfstest.yml
+++ b/playbooks/nfstest.yml
@@ -1,4 +1,5 @@
---
-- hosts: all
+- name: nfstest
+ hosts: all
roles:
- role: nfstest
diff --git a/playbooks/pkg.yml b/playbooks/pkg.yml
index f9d3e624551174e174d97e72776481b8a09d8505..60bee3cbd0382e2f2e0047fe1fadf245b685bc34 100644
--- a/playbooks/pkg.yml
+++ b/playbooks/pkg.yml
@@ -1,4 +1,5 @@
---
-- hosts: all
+- name: pkg
+ hosts: all
roles:
- role: pkg
diff --git a/playbooks/pynfs.yml b/playbooks/pynfs.yml
index ad5b3e2b07328d2a63efb8e28694d38c9570950f..ea01b9af880476e3bbe74114f996885f7e922148 100644
--- a/playbooks/pynfs.yml
+++ b/playbooks/pynfs.yml
@@ -1,4 +1,5 @@
---
-- hosts: all
+- name: pynfs
+ hosts: all
roles:
- role: pynfs
diff --git a/playbooks/reboot-limit.yml b/playbooks/reboot-limit.yml
index 37936237b5024700bb5fdf6e48cbf86120cc9900..160d6b9119788aed82e80740ecc2ab1edb208d89 100644
--- a/playbooks/reboot-limit.yml
+++ b/playbooks/reboot-limit.yml
@@ -1,4 +1,5 @@
---
-- hosts: all
+- name: reboot-limit
+ hosts: all
roles:
- role: reboot-limit
diff --git a/playbooks/rxe.yml b/playbooks/rxe.yml
index dc51c0347628df781e4846bc72614300894a0a95..2204b10c136d5b2e0eb0e3262a9f2491fefdfce8 100644
--- a/playbooks/rxe.yml
+++ b/playbooks/rxe.yml
@@ -1,4 +1,5 @@
---
-- hosts: all
+- name: rxe
+ hosts: all
roles:
- role: rxe
diff --git a/playbooks/selftests.yml b/playbooks/selftests.yml
index 6f7d7770816e2e34614fef4eee557fb615fafe14..2de584cb3c22ac08fa2d675ee5ef504671e8a389 100644
--- a/playbooks/selftests.yml
+++ b/playbooks/selftests.yml
@@ -1,4 +1,5 @@
---
-- hosts: all
+- name: selftests
+ hosts: all
roles:
- role: selftests
diff --git a/playbooks/siw.yml b/playbooks/siw.yml
index 5258a5af9dca98873b0dbfb921169ea9de505f7c..cc546919681a15dff2a82472e1889711301b7a5c 100644
--- a/playbooks/siw.yml
+++ b/playbooks/siw.yml
@@ -1,4 +1,5 @@
---
-- hosts: all
+- name: siw
+ hosts: all
roles:
- role: siw
diff --git a/playbooks/smbd.yml b/playbooks/smbd.yml
index 47cd0223164aa7970d2d20e520fb0468d03bc655..258edec6c5889b2a98a450d230b07a684b28568a 100644
--- a/playbooks/smbd.yml
+++ b/playbooks/smbd.yml
@@ -1,4 +1,5 @@
---
-- hosts: all
+- name: smbd
+ hosts: all
roles:
- role: smbd
diff --git a/playbooks/sysbench.yml b/playbooks/sysbench.yml
index 61026356edc78a004fd01cd2f63a546bc13bc0d3..9cc043ba9d7a67f44d5b297dc8d0ea9cbe6b89ae 100644
--- a/playbooks/sysbench.yml
+++ b/playbooks/sysbench.yml
@@ -1,4 +1,5 @@
---
-- hosts: all
+- name: sysbench
+ hosts: all
roles:
- role: sysbench
diff --git a/playbooks/terraform.yml b/playbooks/terraform.yml
index 374a76fb0ae73da8598bec53590e01b85a528053..1d212bd143ab49cc68b919022e8971d64c30270b 100644
--- a/playbooks/terraform.yml
+++ b/playbooks/terraform.yml
@@ -1,5 +1,6 @@
---
-- hosts: all
+- name: terraform
+ hosts: all
gather_facts: false
roles:
- role: terraform
diff --git a/playbooks/update_etc_hosts.yml b/playbooks/update_etc_hosts.yml
index a0c217411400a00cf6fccf00bb47860081ed9256..57d921ff627a6ffe798dfe90b49b769cd46fe62c 100644
--- a/playbooks/update_etc_hosts.yml
+++ b/playbooks/update_etc_hosts.yml
@@ -1,5 +1,6 @@
---
-- hosts: all
+- name: update_etc_hosts
+ hosts: all
gather_facts: no
roles:
- role: update_etc_hosts
--
2.49.0
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH 2/8] playbooks: fix playbook name for localhost plays
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 ` Daniel Gomez
2025-05-01 18:35 ` [PATCH 3/8] Makefile: use long form of limit argument for clarity Daniel Gomez
` (6 subsequent siblings)
8 siblings, 0 replies; 20+ messages in thread
From: Daniel Gomez @ 2025-05-01 18:35 UTC (permalink / raw)
To: Luis Chamberlain, Chuck Lever; +Cc: kdevops, Daniel Gomez, Daniel Gomez
From: Daniel Gomez <da.gomez@samsung.com>
Fix name rule by naming all the playbooks that run in localhost.
https://ansible.readthedocs.io/projects/lint/rules/name/
Signed-off-by: Daniel Gomez <da.gomez@samsung.com>
---
playbooks/bootlinux-local.yml | 3 ++-
playbooks/bringup_guestfs.yml | 3 ++-
playbooks/build_qemu.yml | 3 ++-
playbooks/fstests.yml | 3 ++-
playbooks/gen-pci-kconfig.yml | 3 ++-
playbooks/gen_hosts.yml | 3 ++-
playbooks/gen_nodes.yml | 3 ++-
playbooks/gen_tfvars.yml | 3 ++-
playbooks/hypervisor-tuning.yml | 3 ++-
| 3 ++-
playbooks/install_systemd_journal_remote.yml | 3 ++-
playbooks/install_systemd_timesyncd.yml | 3 ++-
playbooks/install_terraform.yml | 3 ++-
playbooks/install_vagrant_boxes.yml | 3 ++-
playbooks/kdevops_archive.yml | 3 ++-
playbooks/libvirt_pcie_passthrough.yml | 3 ++-
playbooks/libvirt_storage_pool_create.yml | 3 ++-
playbooks/libvirt_user.yml | 3 ++-
playbooks/linux-mirror.yml | 3 ++-
playbooks/postfix_relay_host.yml | 3 ++-
playbooks/update_ssh_config_guestfs.yml | 3 ++-
playbooks/update_ssh_config_vagrant.yml | 3 ++-
22 files changed, 44 insertions(+), 22 deletions(-)
diff --git a/playbooks/bootlinux-local.yml b/playbooks/bootlinux-local.yml
index e342f0e56fb11da6bdc11e9a011ce21b07e84819..c8e391522c2635196e6d34b8c3312d44bf64fef2 100644
--- a/playbooks/bootlinux-local.yml
+++ b/playbooks/bootlinux-local.yml
@@ -1,5 +1,6 @@
---
-- hosts: localhost
+- name: bootlinux-local
+ hosts: localhost
connection: local
roles:
- role: bootlinux-local
diff --git a/playbooks/bringup_guestfs.yml b/playbooks/bringup_guestfs.yml
index 80a1afcd0a69912a4f2e8c23eba1a108c4df7809..08fcabbcc838bda167cae6b4e0b5fb675900ddf0 100644
--- a/playbooks/bringup_guestfs.yml
+++ b/playbooks/bringup_guestfs.yml
@@ -1,4 +1,5 @@
---
-- hosts: localhost
+- name: bringup_guestfs
+ hosts: localhost
roles:
- role: bringup_guestfs
diff --git a/playbooks/build_qemu.yml b/playbooks/build_qemu.yml
index d094c258246588b88643901bf8f11e29129655e4..d7056ad472d67f971cf5d006d0a0c54c5fd34682 100644
--- a/playbooks/build_qemu.yml
+++ b/playbooks/build_qemu.yml
@@ -1,4 +1,5 @@
---
-- hosts: localhost
+- name: build_qemu
+ hosts: localhost
roles:
- role: build_qemu
diff --git a/playbooks/fstests.yml b/playbooks/fstests.yml
index de8cb251f29c11bd0f85a347534f7b00f2285ab7..08e5f465492090fe39b6214449fabc123bf8ff77 100644
--- a/playbooks/fstests.yml
+++ b/playbooks/fstests.yml
@@ -1,5 +1,6 @@
---
-- hosts: localhost
+- name: fstests
+ hosts: localhost
roles:
- role: fstests_prep_localhost
diff --git a/playbooks/gen-pci-kconfig.yml b/playbooks/gen-pci-kconfig.yml
index a20aba761a8c91f40e42cdf719b4d1635931ca58..ede0c16a451f4c538078fcf40aed45de036bbb1c 100644
--- a/playbooks/gen-pci-kconfig.yml
+++ b/playbooks/gen-pci-kconfig.yml
@@ -1,4 +1,5 @@
---
-- hosts: localhost
+- name: gen-pci-kconfig
+ hosts: localhost
roles:
- role: gen_pci_kconfig
diff --git a/playbooks/gen_hosts.yml b/playbooks/gen_hosts.yml
index 942b4f2ac52c91d4c1a0272c9bd2c29f4d65345b..67207101d87385ef149b43e7e066513d1b516903 100644
--- a/playbooks/gen_hosts.yml
+++ b/playbooks/gen_hosts.yml
@@ -1,4 +1,5 @@
---
-- hosts: localhost
+- name: gen_hosts
+ hosts: localhost
roles:
- role: gen_hosts
diff --git a/playbooks/gen_nodes.yml b/playbooks/gen_nodes.yml
index c298b344647cf3d416b49957aeee75fc0c834da8..4989ce733de26fa4884247e390c14fa3fa332679 100644
--- a/playbooks/gen_nodes.yml
+++ b/playbooks/gen_nodes.yml
@@ -1,4 +1,5 @@
---
-- hosts: localhost
+- name: gen_nodes
+ hosts: localhost
roles:
- role: gen_nodes
diff --git a/playbooks/gen_tfvars.yml b/playbooks/gen_tfvars.yml
index 5ff85af6ab82d260c5bacbb7d334c6838e9b5ab2..ab6048744828de5badee5df59609f27ad9b27c80 100644
--- a/playbooks/gen_tfvars.yml
+++ b/playbooks/gen_tfvars.yml
@@ -1,4 +1,5 @@
---
-- hosts: localhost
+- name: gen_tfvars
+ hosts: localhost
roles:
- role: gen_tfvars
diff --git a/playbooks/hypervisor-tuning.yml b/playbooks/hypervisor-tuning.yml
index 29f735d8f8fcf21fd87aeaaaab541721d5a9f1da..a599c828e0c8d1e6a48c6fdc0a63b907962a4180 100644
--- a/playbooks/hypervisor-tuning.yml
+++ b/playbooks/hypervisor-tuning.yml
@@ -1,4 +1,5 @@
---
-- hosts: localhost
+- name: hypervisor-tuning
+ hosts: localhost
roles:
- role: hypervisor-tuning
--git a/playbooks/install-menuconfig-deps.yml b/playbooks/install-menuconfig-deps.yml
index 845b287073842feed7bb051ae16a627fcc9f4fdc..4400e59e44cf2ccaec6be2193c940f0c8c46a8b9 100644
--- a/playbooks/install-menuconfig-deps.yml
+++ b/playbooks/install-menuconfig-deps.yml
@@ -1,4 +1,5 @@
---
-- hosts: localhost
+- name: install-menuconfig-deps
+ hosts: localhost
roles:
- role: install-menuconfig-deps
diff --git a/playbooks/install_systemd_journal_remote.yml b/playbooks/install_systemd_journal_remote.yml
index 46014d285b0b309dc4c8eb527fede3abefd453ee..26998b84691ae009f68dcd204df26d2777b5add3 100644
--- a/playbooks/install_systemd_journal_remote.yml
+++ b/playbooks/install_systemd_journal_remote.yml
@@ -1,4 +1,5 @@
---
-- hosts: localhost
+- name: install_systemd_journal_remote
+ hosts: localhost
roles:
- role: install_systemd_journal_remote
diff --git a/playbooks/install_systemd_timesyncd.yml b/playbooks/install_systemd_timesyncd.yml
index ed1a31e64790d6b9bd4d95e591e71fb0505a739f..bcda04007f6d4288c5dd8db28bf03e966a7ad5c9 100644
--- a/playbooks/install_systemd_timesyncd.yml
+++ b/playbooks/install_systemd_timesyncd.yml
@@ -1,4 +1,5 @@
---
-- hosts: localhost
+- name: install_systemd_timesyncd
+ hosts: localhost
roles:
- role: install_systemd_timesyncd
diff --git a/playbooks/install_terraform.yml b/playbooks/install_terraform.yml
index 1426378eee25cc12c75f8f6faeaedbb94228ad69..9b4de68a6a8174ed465321bf526ca2e546b60be2 100644
--- a/playbooks/install_terraform.yml
+++ b/playbooks/install_terraform.yml
@@ -1,4 +1,5 @@
---
-- hosts: localhost
+- name: install_terraform
+ hosts: localhost
roles:
- role: install_terraform
diff --git a/playbooks/install_vagrant_boxes.yml b/playbooks/install_vagrant_boxes.yml
index 8cffb36a981e302b4b924e94fbd0b7a8850d4e6f..01c0728864a1dadcac35a637d5e246dd76376dde 100644
--- a/playbooks/install_vagrant_boxes.yml
+++ b/playbooks/install_vagrant_boxes.yml
@@ -1,5 +1,6 @@
---
-- hosts: localhost
+- name: install_vagrant_boxes
+ hosts: localhost
tasks:
- include_role:
name: install_vagrant_boxes
diff --git a/playbooks/kdevops_archive.yml b/playbooks/kdevops_archive.yml
index a61f794ae12bf90e204eb7fdc2d59045d57a1d59..2c5f833928fa31afd78725ca9588aa8ad9aff4fe 100644
--- a/playbooks/kdevops_archive.yml
+++ b/playbooks/kdevops_archive.yml
@@ -1,4 +1,5 @@
---
-- hosts: localhost
+- name: kdevops_archive
+ hosts: localhost
roles:
- role: kdevops_archive
diff --git a/playbooks/libvirt_pcie_passthrough.yml b/playbooks/libvirt_pcie_passthrough.yml
index 39d5c8ee38fc60bdf397c0fae82ba497815e139e..2e83fef1b86b93bdb475f5e207180b459fc49722 100644
--- a/playbooks/libvirt_pcie_passthrough.yml
+++ b/playbooks/libvirt_pcie_passthrough.yml
@@ -1,4 +1,5 @@
---
-- hosts: localhost
+- name: libvirt_pcie_passthrough
+ hosts: localhost
roles:
- role: libvirt_pcie_passthrough
diff --git a/playbooks/libvirt_storage_pool_create.yml b/playbooks/libvirt_storage_pool_create.yml
index f127f5e4311f499c6b80251406fcf180854e4406..9bec5914cfc33c96f6cda6f14fbf374d957143eb 100644
--- a/playbooks/libvirt_storage_pool_create.yml
+++ b/playbooks/libvirt_storage_pool_create.yml
@@ -1,4 +1,5 @@
---
-- hosts: localhost
+- name: libvirt_storage_pool_create
+ hosts: localhost
roles:
- role: libvirt_storage_pool_create
diff --git a/playbooks/libvirt_user.yml b/playbooks/libvirt_user.yml
index 6e3889ca65cfd4a50edbf2c1f8b747dd554bc1e4..84e5637b554bf53e23d97ff72cc04b7f5ce04819 100644
--- a/playbooks/libvirt_user.yml
+++ b/playbooks/libvirt_user.yml
@@ -1,4 +1,5 @@
---
-- hosts: localhost
+- name: libvirt_user
+ hosts: localhost
roles:
- role: libvirt_user
diff --git a/playbooks/linux-mirror.yml b/playbooks/linux-mirror.yml
index 0808ebc1df80e197807703b547ae41f66192d0f1..05bfa02f720dd454f941cc513ec774b69f07bf5e 100644
--- a/playbooks/linux-mirror.yml
+++ b/playbooks/linux-mirror.yml
@@ -1,4 +1,5 @@
---
-- hosts: localhost
+- name: linux-mirror
+ hosts: localhost
roles:
- role: linux-mirror
diff --git a/playbooks/postfix_relay_host.yml b/playbooks/postfix_relay_host.yml
index b04079bcc3190b30a79a7898b64171d25c2889c3..507ca56998c95bc40f0dcc368d881bacc60e1502 100644
--- a/playbooks/postfix_relay_host.yml
+++ b/playbooks/postfix_relay_host.yml
@@ -1,4 +1,5 @@
---
-- hosts: localhost
+- name: postfix_relay_host
+ hosts: localhost
roles:
- role: postfix_relay_host
diff --git a/playbooks/update_ssh_config_guestfs.yml b/playbooks/update_ssh_config_guestfs.yml
index 346b90245637ee7ca1297cfd9c0838c1d9a5ef25..3fe45a8c872356a503b17715263811274929de2f 100644
--- a/playbooks/update_ssh_config_guestfs.yml
+++ b/playbooks/update_ssh_config_guestfs.yml
@@ -1,4 +1,5 @@
---
-- hosts: localhost
+- name: update_ssh_config_guestfs
+ hosts: localhost
roles:
- role: update_ssh_config_guestfs
diff --git a/playbooks/update_ssh_config_vagrant.yml b/playbooks/update_ssh_config_vagrant.yml
index c8d0e9962d46bb504c89611c8c5c753a72a61775..7a2162e96c1d90014bb86129f27e303690ffc31f 100644
--- a/playbooks/update_ssh_config_vagrant.yml
+++ b/playbooks/update_ssh_config_vagrant.yml
@@ -1,4 +1,5 @@
---
-- hosts: localhost
+- name: update_ssh_config_vagrant
+ hosts: localhost
roles:
- role: update_ssh_config_vagrant
--
2.49.0
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH 3/8] Makefile: use long form of limit argument for clarity
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 ` Daniel Gomez
2025-05-01 18:35 ` [PATCH 4/8] Makefile: print target when debug Daniel Gomez
` (5 subsequent siblings)
8 siblings, 0 replies; 20+ messages in thread
From: Daniel Gomez @ 2025-05-01 18:35 UTC (permalink / raw)
To: Luis Chamberlain, Chuck Lever; +Cc: kdevops, Daniel Gomez, Daniel Gomez
From: Daniel Gomez <da.gomez@samsung.com>
Replace the short -l argument option with the more explicit --limit in
the Makefile for ansible-playbook runs. This improves readability and
makes the purpose of the flag clearer.
Signed-off-by: Daniel Gomez <da.gomez@samsung.com>
---
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index bf911e61e1d525ec2d5db42cca50f7f04db61689..b6133ed5415e01cf9af7c2a0ca40976746acd2fd 100644
--- a/Makefile
+++ b/Makefile
@@ -62,7 +62,7 @@ include scripts/ansible.Makefile
LIMIT_HOSTS :=
ifneq (,$(HOSTS))
-LIMIT_HOSTS := '-l $(subst ${space},$(comma),$(HOSTS))'
+LIMIT_HOSTS := '--limit $(subst ${space},$(comma),$(HOSTS))'
endif
export LIMIT_TESTS :=
--
2.49.0
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH 4/8] Makefile: print target when debug
2025-05-01 18:35 [PATCH 0/8] Define Ansible inventory in the Ansible Configuration file Daniel Gomez
` (2 preceding siblings ...)
2025-05-01 18:35 ` [PATCH 3/8] Makefile: use long form of limit argument for clarity Daniel Gomez
@ 2025-05-01 18:35 ` Daniel Gomez
2025-05-01 18:35 ` [PATCH 5/8] .github/workflows/fstests.yml: enable make verbosity Daniel Gomez
` (4 subsequent siblings)
8 siblings, 0 replies; 20+ messages in thread
From: Daniel Gomez @ 2025-05-01 18:35 UTC (permalink / raw)
To: Luis Chamberlain, Chuck Lever; +Cc: kdevops, Daniel Gomez, Daniel Gomez
From: Daniel Gomez <da.gomez@samsung.com>
When debugging with V=1, print also the Makefile target before the
command.
This allows to speciy the target as well as keep verbosity of the
command being executed. The only limitations is that commands are
printed in one line.
Example:
make V=1
==> [ansible.cfg]
+ ansible-playbook playbooks/ansible_cfg.yml --extra-vars=@./.extra_vars_auto.yaml
[WARNING]: You are running the development version of Ansible. You
should only run Ansible from "devel" if you are modifying the Ansible
engine, or trying out features under development. This is a rapidly
changing source of code and can become unstable at any point.
PLAY 1: ANSIBLE CONFIGURATION ROLE
task 1. [started TASK: Gathering Facts on localhost]
task 2. [started TASK: ansible_cfg : Import optional extra_args file on localhost]
task 3. [started TASK: ansible_cfg : Generate kdevops ansible.cfg on localhost]
==> [inventory]
+ ansible-playbook playbooks/gen_hosts.yml --extra-vars=@./extra_vars.yaml
{...}
Before:
make V=1
[WARNING]: You are running the development version of Ansible. You
should only run Ansible from "devel" if you are modifying the Ansible
engine, or trying out features under development. This is a rapidly
changing source of code and can become unstable at any point.
PLAY 1: ANSIBLE CONFIGURATION ROLE
task 1. [started TASK: Gathering Facts on localhost]
task 2. [started TASK: ansible_cfg : Import optional extra_args file on localhost]
task 3. [started TASK: ansible_cfg : Generate kdevops ansible.cfg on localhost]
ansible-playbook \
playbooks/gen_hosts.yml \
--extra-vars=@./extra_vars.yaml
[WARNING]: You are running the development version of Ansible. You
should only run Ansible from "devel" if you are modifying the Ansible
engine, or trying out features under development. This is a rapidly
changing source of code and can become unstable at any point.
PLAY 1: GEN_HOSTS
task 1. [started TASK: Gathering Facts on localhost]
{...}
Signed-off-by: Daniel Gomez <da.gomez@samsung.com>
---
Makefile | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index b6133ed5415e01cf9af7c2a0ca40976746acd2fd..7d522d5f918cf81da6fec9258c8c174e48fed11a 100644
--- a/Makefile
+++ b/Makefile
@@ -38,8 +38,12 @@ KDEVOPS_DEPCHECK = .kdevops.depcheck
PHONY += kconfig-help-menu
+define print_target
+ echo "==> [$1]"
+endef
+
ifeq ($(V),1)
-export Q=
+export Q=@$(call print_target,$@) && set -x &&
export NQ=true
else
export Q=@
--
2.49.0
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH 5/8] .github/workflows/fstests.yml: enable make verbosity
2025-05-01 18:35 [PATCH 0/8] Define Ansible inventory in the Ansible Configuration file Daniel Gomez
` (3 preceding siblings ...)
2025-05-01 18:35 ` [PATCH 4/8] Makefile: print target when debug Daniel Gomez
@ 2025-05-01 18:35 ` Daniel Gomez
2025-05-01 18:35 ` [PATCH 6/8] ansible_cfg: add inventory support Daniel Gomez
` (3 subsequent siblings)
8 siblings, 0 replies; 20+ messages in thread
From: Daniel Gomez @ 2025-05-01 18:35 UTC (permalink / raw)
To: Luis Chamberlain, Chuck Lever; +Cc: kdevops, Daniel Gomez, Daniel Gomez
From: Daniel Gomez <da.gomez@samsung.com>
This prints the commands as well as the Makefile target being run.
Signed-off-by: Daniel Gomez <da.gomez@samsung.com>
---
.github/workflows/fstests.yml | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/.github/workflows/fstests.yml b/.github/workflows/fstests.yml
index e06f5e009c6a380c82321e9437494549ec42cf62..8f231169a896edc2ad5ab080a56701a9664ee5b3 100644
--- a/.github/workflows/fstests.yml
+++ b/.github/workflows/fstests.yml
@@ -44,23 +44,23 @@ jobs:
- name: Run kdevops make
run: |
- make -j$(nproc)
+ make V=1 -j$(nproc)
- name: Run kdevops make bringup
run: |
- make bringup
+ make V=1 bringup
- name: Build linux and boot test nodes on test kernel
run: |
- make linux
+ make V=1 linux
- name: Build fstests
run: |
- make fstests
+ make V=1 fstests
- name: Run just one fstest to verify we tests and test collection works
run: |
- make fstests-baseline TESTS=generic/003
+ make V=1 fstests-baseline TESTS=generic/003
echo "ok" > ci.result
find workflows/fstests/results/last-run -name xunit_results.txt -type f -exec cat {} \; > ci.commit_extra || true
if ! grep -E "failures, [1-9]|errors, [1-9]" ci.commit_extra; then
@@ -70,7 +70,7 @@ jobs:
- name: Get systemd journal files
if: always() # This ensures the step runs even if previous steps failed
run: |
- make journal-dump
+ make V=1 journal-dump
- name: Start SSH Agent
if: always() # Ensure this step runs even if previous steps failed
@@ -81,7 +81,7 @@ jobs:
- name: Build our kdevops archive results
if: always() # This ensures the step runs even if previous steps failed
run: |
- make ci-archive
+ make V=1 ci-archive
- name: Upload our kdevops results archive
if: always() # This ensures the step runs even if previous steps failed
@@ -94,4 +94,4 @@ jobs:
- name: Run kdevops make destroy
if: always() # This ensures the step runs even if previous steps failed
run: |
- make destroy
+ make V=1 destroy
--
2.49.0
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH 6/8] ansible_cfg: add inventory support
2025-05-01 18:35 [PATCH 0/8] Define Ansible inventory in the Ansible Configuration file Daniel Gomez
` (4 preceding siblings ...)
2025-05-01 18:35 ` [PATCH 5/8] .github/workflows/fstests.yml: enable make verbosity Daniel Gomez
@ 2025-05-01 18:35 ` Daniel Gomez
2025-05-01 19:41 ` Chuck Lever
2025-05-01 18:35 ` [PATCH 7/8] gen_hosts: templates: add localhost to all hosts Daniel Gomez
` (2 subsequent siblings)
8 siblings, 1 reply; 20+ messages in thread
From: Daniel Gomez @ 2025-05-01 18:35 UTC (permalink / raw)
To: Luis Chamberlain, Chuck Lever; +Cc: kdevops, Daniel Gomez, Daniel Gomez
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"
+ output yaml
+ default "$(TOPDIR_PATH)/hosts"
+
if DISTRO_OPENSUSE
config ANSIBLE_CFG_RECONNECTION_RETRIES
diff --git a/kconfigs/Kconfig.ansible_provisioning b/kconfigs/Kconfig.ansible_provisioning
index 63f04306e7b26f228defa9e50630f5ed07eaac37..4416d06754df3a9645fef15173e83e2279cfce1a 100644
--- a/kconfigs/Kconfig.ansible_provisioning
+++ b/kconfigs/Kconfig.ansible_provisioning
@@ -98,12 +98,6 @@ config KDEVOPS_DEVCONFIG_SYSTEMD_WATCHDOG_TIMEOUT_KEXEC
endif # KDEVOPS_DEVCONFIG_ENABLE_SYSTEMD_WATCHDOG
-config KDEVOPS_ANSIBLE_INVENTORY_FILE
- string "The ansible inventory file to use"
- default $(shell, scripts/append-makefile-vars.sh $(KDEVOPS_HOSTFILE))
- help
- The file to use for the ansible inventory.
-
config HAVE_DISTRO_PREFERS_ANSIBLE_PYTHON2
bool
default n
diff --git a/playbooks/roles/ansible_cfg/templates/ansible.cfg.j2 b/playbooks/roles/ansible_cfg/templates/ansible.cfg.j2
index 2bc916321f424ab93447af40eccef30911d27bb6..fddbab6d3a4dc03524a819b5b695336445ecb732 100644
--- a/playbooks/roles/ansible_cfg/templates/ansible.cfg.j2
+++ b/playbooks/roles/ansible_cfg/templates/ansible.cfg.j2
@@ -10,6 +10,7 @@ show_per_host_start = {{ ansible_cfg_callback_plugin_show_per_host_start }}
show_task_path_on_failure = {{ ansible_cfg_callback_plugin_show_task_path_on_failure }}
interpreter_python = {{ ansible_cfg_interpreter_python_string }}
forks = {{ ansible_cfg_forks }}
+inventory = {{ ansible_cfg_inventory }}
{% if ansible_facts['distribution'] == 'openSUSE' %}
[connection]
retries = {{ ansible_cfg_reconnection_retries }}
--
2.49.0
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH 7/8] gen_hosts: templates: add localhost to all hosts
2025-05-01 18:35 [PATCH 0/8] Define Ansible inventory in the Ansible Configuration file Daniel Gomez
` (5 preceding siblings ...)
2025-05-01 18:35 ` [PATCH 6/8] ansible_cfg: add inventory support Daniel Gomez
@ 2025-05-01 18:35 ` 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
8 siblings, 0 replies; 20+ messages in thread
From: Daniel Gomez @ 2025-05-01 18:35 UTC (permalink / raw)
To: Luis Chamberlain, Chuck Lever; +Cc: kdevops, Daniel Gomez, Daniel Gomez
From: Daniel Gomez <da.gomez@samsung.com>
This redefines the concept of all targets but allows to really include
'all' hosts in the Ansible inventory file (hosts).
Change playbooks hosts list to exclude localhost when using all.
Signed-off-by: Daniel Gomez <da.gomez@samsung.com>
---
playbooks/blktests.yml | 2 +-
playbooks/common.yml | 2 +-
playbooks/create_data_partition.yml | 2 +-
playbooks/cxl.yml | 2 +-
playbooks/devconfig.yml | 2 +-
playbooks/fstests.yml | 2 +-
playbooks/gitr.yml | 2 +-
playbooks/iscsi.yml | 2 +-
playbooks/kdc.yml | 2 +-
playbooks/krb5.yml | 2 +-
playbooks/ktls.yml | 2 +-
playbooks/ltp.yml | 2 +-
playbooks/nfsd.yml | 2 +-
playbooks/nfstest.yml | 2 +-
playbooks/pkg.yml | 2 +-
playbooks/pynfs.yml | 2 +-
playbooks/reboot-limit.yml | 2 +-
playbooks/roles/gen_hosts/templates/blktests.j2 | 1 +
playbooks/roles/gen_hosts/templates/cxl.j2 | 1 +
playbooks/roles/gen_hosts/templates/fstests.j2 | 1 +
playbooks/roles/gen_hosts/templates/gitr.j2 | 1 +
playbooks/roles/gen_hosts/templates/hosts.j2 | 2 ++
playbooks/roles/gen_hosts/templates/ltp.j2 | 1 +
playbooks/roles/gen_hosts/templates/nfstest.j2 | 1 +
playbooks/roles/gen_hosts/templates/pynfs.j2 | 1 +
playbooks/roles/gen_hosts/templates/selftests.j2 | 1 +
playbooks/roles/gen_hosts/templates/sysbench.j2 | 1 +
playbooks/rxe.yml | 2 +-
playbooks/selftests.yml | 2 +-
playbooks/siw.yml | 2 +-
playbooks/smbd.yml | 2 +-
playbooks/sysbench.yml | 2 +-
playbooks/terraform.yml | 2 +-
playbooks/update_etc_hosts.yml | 2 +-
scripts/guestfs.Makefile | 2 +-
workflows/linux/Makefile | 2 +-
36 files changed, 37 insertions(+), 26 deletions(-)
diff --git a/playbooks/blktests.yml b/playbooks/blktests.yml
index 91b484fbef5f8868b97fff337eaf5011e4c7f9f6..256a6eaf38820e7a16ce96a3daf705daa73c6e52 100644
--- a/playbooks/blktests.yml
+++ b/playbooks/blktests.yml
@@ -1,5 +1,5 @@
---
- name: blktests
- hosts: all
+ hosts: all:!localhost
roles:
- role: blktests
diff --git a/playbooks/common.yml b/playbooks/common.yml
index c4f0102b4bd5729d9ae347ae5c80a0a04576312e..4e7803bcad19accdc7612936743f38a8734210ee 100644
--- a/playbooks/common.yml
+++ b/playbooks/common.yml
@@ -1,5 +1,5 @@
---
- name: common
- hosts: all
+ hosts: all:!localhost
roles:
- role: common
diff --git a/playbooks/create_data_partition.yml b/playbooks/create_data_partition.yml
index 9cf4d0506c830847d54aa02555e0cc705b031cb3..b2463122c8b3bcd32c87a2b13921350b04502404 100644
--- a/playbooks/create_data_partition.yml
+++ b/playbooks/create_data_partition.yml
@@ -1,5 +1,5 @@
---
- name: create_data_partition
- hosts: all
+ hosts: all:!localhost
roles:
- role: create_data_partition
diff --git a/playbooks/cxl.yml b/playbooks/cxl.yml
index 65277d435a6fe13661febfea78181bf3a13e4dfc..9774044920269642512a5347ff3f112ee9d5f76f 100644
--- a/playbooks/cxl.yml
+++ b/playbooks/cxl.yml
@@ -1,5 +1,5 @@
---
- name: cxl
- hosts: all
+ hosts: all:!localhost
roles:
- role: cxl
diff --git a/playbooks/devconfig.yml b/playbooks/devconfig.yml
index 45eb163bedd95c9cb8736f3cb68954df6dacf941..a934fb6b700f577bbe756e7a152481f44e2a9cc3 100644
--- a/playbooks/devconfig.yml
+++ b/playbooks/devconfig.yml
@@ -1,6 +1,6 @@
---
- name: devconfig
- hosts: all
+ hosts: all:!localhost
gather_facts: no
roles:
- role: devconfig
diff --git a/playbooks/fstests.yml b/playbooks/fstests.yml
index 08e5f465492090fe39b6214449fabc123bf8ff77..db15d6c9619b8466cc5f85bd0a06be3afcfa2bb0 100644
--- a/playbooks/fstests.yml
+++ b/playbooks/fstests.yml
@@ -4,6 +4,6 @@
roles:
- role: fstests_prep_localhost
-- hosts: all
+- hosts: all:!localhost
roles:
- role: fstests
diff --git a/playbooks/gitr.yml b/playbooks/gitr.yml
index 5037a813f6b0a759bede52d7092af2bff218315b..e854477a20f595eb2ae3ac971dd47428eda8c049 100644
--- a/playbooks/gitr.yml
+++ b/playbooks/gitr.yml
@@ -1,5 +1,5 @@
---
- name: gitr
- hosts: all
+ hosts: all:!localhost
roles:
- role: gitr
diff --git a/playbooks/iscsi.yml b/playbooks/iscsi.yml
index 5b3c4f356d8864761e5d768c81d740180a20740c..c2a2dcf9ac761e07fcd7c0f563da7fd2d8046dfa 100644
--- a/playbooks/iscsi.yml
+++ b/playbooks/iscsi.yml
@@ -1,5 +1,5 @@
---
- name: iscsi
- hosts: all
+ hosts: all:!localhost
roles:
- role: iscsi
diff --git a/playbooks/kdc.yml b/playbooks/kdc.yml
index 27de7faf436dd3061fbe20c22bac5f0131a21356..bbc70a072ea368b66f8b4a407f4603ff08093975 100644
--- a/playbooks/kdc.yml
+++ b/playbooks/kdc.yml
@@ -1,5 +1,5 @@
---
- name: kdc
- hosts: all
+ hosts: all:!localhost
roles:
- role: kdc
diff --git a/playbooks/krb5.yml b/playbooks/krb5.yml
index 8d65e560dab24b1a8f1457334c5a426dc40108c9..74307e794fa7d5d56a5c0095e08e59ffde91547c 100644
--- a/playbooks/krb5.yml
+++ b/playbooks/krb5.yml
@@ -1,5 +1,5 @@
---
- name: krb5
- hosts: all
+ hosts: all:!localhost
roles:
- role: krb5
diff --git a/playbooks/ktls.yml b/playbooks/ktls.yml
index 70cc9c0c8fc3090083e4487298096252ebd5d7aa..5e14a8e2c37fb6f93d3edf9485b494e2aeb82dfe 100644
--- a/playbooks/ktls.yml
+++ b/playbooks/ktls.yml
@@ -1,5 +1,5 @@
---
- name: ktls
- hosts: all
+ hosts: all:!localhost
roles:
- role: ktls
diff --git a/playbooks/ltp.yml b/playbooks/ltp.yml
index c01022f5f765b7e084c3806acd3d9ce249e445d6..8c46ceb69bfe4ec6760467d57cd58dee73fd6423 100644
--- a/playbooks/ltp.yml
+++ b/playbooks/ltp.yml
@@ -1,5 +1,5 @@
---
- name: ltp
- hosts: all
+ hosts: all:!localhost
roles:
- role: ltp
diff --git a/playbooks/nfsd.yml b/playbooks/nfsd.yml
index edb8b1ff8de9eaf91cceedab7fe0a4672b1d7148..626f532a89c872f8743252d1dfc899ca27cf73f3 100644
--- a/playbooks/nfsd.yml
+++ b/playbooks/nfsd.yml
@@ -1,5 +1,5 @@
---
- name: nfsd
- hosts: all
+ hosts: all:!localhost
roles:
- role: nfsd
diff --git a/playbooks/nfstest.yml b/playbooks/nfstest.yml
index 03715ebf45f90070ba1d57feab27720f23d28d5e..4c19c8ce63af7f2f6801ba6a3d91ca8c6aca000d 100644
--- a/playbooks/nfstest.yml
+++ b/playbooks/nfstest.yml
@@ -1,5 +1,5 @@
---
- name: nfstest
- hosts: all
+ hosts: all:!localhost
roles:
- role: nfstest
diff --git a/playbooks/pkg.yml b/playbooks/pkg.yml
index 60bee3cbd0382e2f2e0047fe1fadf245b685bc34..3a613894589af9c1449248dc0993d25440d61f96 100644
--- a/playbooks/pkg.yml
+++ b/playbooks/pkg.yml
@@ -1,5 +1,5 @@
---
- name: pkg
- hosts: all
+ hosts: all:!localhost
roles:
- role: pkg
diff --git a/playbooks/pynfs.yml b/playbooks/pynfs.yml
index ea01b9af880476e3bbe74114f996885f7e922148..8e8f8807bb3dc6c93678a948db7787efce7f51d3 100644
--- a/playbooks/pynfs.yml
+++ b/playbooks/pynfs.yml
@@ -1,5 +1,5 @@
---
- name: pynfs
- hosts: all
+ hosts: all:!localhost
roles:
- role: pynfs
diff --git a/playbooks/reboot-limit.yml b/playbooks/reboot-limit.yml
index 160d6b9119788aed82e80740ecc2ab1edb208d89..095f76b4b0727e9ff0f8418316dfa86d24588884 100644
--- a/playbooks/reboot-limit.yml
+++ b/playbooks/reboot-limit.yml
@@ -1,5 +1,5 @@
---
- name: reboot-limit
- hosts: all
+ hosts: all:!localhost
roles:
- role: reboot-limit
diff --git a/playbooks/roles/gen_hosts/templates/blktests.j2 b/playbooks/roles/gen_hosts/templates/blktests.j2
index 1c2f8f774b7c67f6410017c764042fa89c0a2c7f..5bf50acbddac3d6f8685cb530f37cd602a97fba8 100644
--- a/playbooks/roles/gen_hosts/templates/blktests.j2
+++ b/playbooks/roles/gen_hosts/templates/blktests.j2
@@ -1,4 +1,5 @@
[all]
+localhost ansible_connection=local
{% for test_type in blktests_enabled_test_types %}
{{ kdevops_host_prefix }}-{{ test_type }}
{% if kdevops_baseline_and_dev %}
diff --git a/playbooks/roles/gen_hosts/templates/cxl.j2 b/playbooks/roles/gen_hosts/templates/cxl.j2
index 1b3034e05d58e1093e3ce4e3fda2336edc0d2653..64bec4561b6c4ef92df4d561b16cc1f69c20e7b2 100644
--- a/playbooks/roles/gen_hosts/templates/cxl.j2
+++ b/playbooks/roles/gen_hosts/templates/cxl.j2
@@ -1,4 +1,5 @@
[all]
+localhost ansible_connection=local
{{ kdevops_hosts_prefix }}
{% if kdevops_baseline_and_dev == True %}
{{ kdevops_hosts_prefix }}-dev
diff --git a/playbooks/roles/gen_hosts/templates/fstests.j2 b/playbooks/roles/gen_hosts/templates/fstests.j2
index abcdafd56686cf2a7b6d3e7f8405ba14041650d9..f5a383ebf383b37335ac120c607b6eb330a2267e 100644
--- a/playbooks/roles/gen_hosts/templates/fstests.j2
+++ b/playbooks/roles/gen_hosts/templates/fstests.j2
@@ -1,4 +1,5 @@
[all]
+localhost ansible_connection=local
{% for s in fstests_enabled_test_types %}
{{ kdevops_host_prefix }}-{{ s }}
{% if kdevops_baseline_and_dev %}
diff --git a/playbooks/roles/gen_hosts/templates/gitr.j2 b/playbooks/roles/gen_hosts/templates/gitr.j2
index b8f393d63f96612a8ce28fd78d0e589adbbd722e..f4190cd0ecb3ba1dcf5385e4bfc7b529440ea81f 100644
--- a/playbooks/roles/gen_hosts/templates/gitr.j2
+++ b/playbooks/roles/gen_hosts/templates/gitr.j2
@@ -1,4 +1,5 @@
[all]
+localhost ansible_connection=local
{% for s in gitr_enabled_hosts %}
{{ kdevops_host_prefix }}-{{ s }}
{% if kdevops_baseline_and_dev %}
diff --git a/playbooks/roles/gen_hosts/templates/hosts.j2 b/playbooks/roles/gen_hosts/templates/hosts.j2
index 5032f592e466e4705979ad0c4eb23e0bb3a7f950..d5f99a69cee87c651315d43e2da4c4f205bf5b12 100644
--- a/playbooks/roles/gen_hosts/templates/hosts.j2
+++ b/playbooks/roles/gen_hosts/templates/hosts.j2
@@ -7,9 +7,11 @@ its own jinja2 template file and define its own ansible task for its generation.
#}
{% if kdevops_workflows_dedicated_workflow %}
[all]
+localhost ansible_connection=local
write-your-own-template-for-your-workflow-and-task
{% else %}
[all]
+localhost ansible_connection=local
{{ kdevops_hosts_prefix }}
{% if kdevops_baseline_and_dev == True %}
{{ kdevops_hosts_prefix }}-dev
diff --git a/playbooks/roles/gen_hosts/templates/ltp.j2 b/playbooks/roles/gen_hosts/templates/ltp.j2
index 5b6ad9485d989c79b269831ad1af57c6970553c5..828fd63627184d98e21b11cb2025c7b67ad11e83 100644
--- a/playbooks/roles/gen_hosts/templates/ltp.j2
+++ b/playbooks/roles/gen_hosts/templates/ltp.j2
@@ -1,4 +1,5 @@
[all]
+localhost ansible_connection=local
{% for s in ltp_enabled_hosts %}
{{ kdevops_host_prefix }}-{{ s }}
{% if kdevops_baseline_and_dev %}
diff --git a/playbooks/roles/gen_hosts/templates/nfstest.j2 b/playbooks/roles/gen_hosts/templates/nfstest.j2
index 6a0d6cdc76323ed721aa17747dee50e3fe50c774..0d3aae9fb1ae4616ec809d67bfa4db1da76b7591 100644
--- a/playbooks/roles/gen_hosts/templates/nfstest.j2
+++ b/playbooks/roles/gen_hosts/templates/nfstest.j2
@@ -1,4 +1,5 @@
[all]
+localhost ansible_connection=local
{% for s in nfstest_enabled_hosts %}
{{ kdevops_host_prefix }}-{{ s }}
{% if kdevops_baseline_and_dev %}
diff --git a/playbooks/roles/gen_hosts/templates/pynfs.j2 b/playbooks/roles/gen_hosts/templates/pynfs.j2
index c018c5428828171cf4e652d0b2c20cc24b9da277..f5a4bb75aea194ad7000f8f4b82c4db4bfcf96ed 100644
--- a/playbooks/roles/gen_hosts/templates/pynfs.j2
+++ b/playbooks/roles/gen_hosts/templates/pynfs.j2
@@ -1,4 +1,5 @@
[all]
+localhost ansible_connection=local
{{ kdevops_hosts_prefix }}-nfsd
[all:vars]
ansible_python_interpreter = "{{ kdevops_python_interpreter }}"
diff --git a/playbooks/roles/gen_hosts/templates/selftests.j2 b/playbooks/roles/gen_hosts/templates/selftests.j2
index 085b73375518e97f901b13728dccee7ecffa5119..e505bbf194b4c45e5978b6be89f28a2b131f06aa 100644
--- a/playbooks/roles/gen_hosts/templates/selftests.j2
+++ b/playbooks/roles/gen_hosts/templates/selftests.j2
@@ -1,4 +1,5 @@
[all]
+localhost ansible_connection=local
{% for test_type in selftests_enabled_test_types %}
{{ kdevops_host_prefix }}-{{ test_type }}
{% if kdevops_baseline_and_dev %}
diff --git a/playbooks/roles/gen_hosts/templates/sysbench.j2 b/playbooks/roles/gen_hosts/templates/sysbench.j2
index 76503ab761760c7ee1605e6e5bdbe9c3f1fa1e16..107eebc5fbce5cbef508aa2fb834f44d4795ce82 100644
--- a/playbooks/roles/gen_hosts/templates/sysbench.j2
+++ b/playbooks/roles/gen_hosts/templates/sysbench.j2
@@ -1,4 +1,5 @@
[all]
+localhost ansible_connection=local
{% for test_type in enabled_sysbench_tests %}
{{ kdevops_host_prefix }}-{{ test_type }}
{% if kdevops_baseline_and_dev %}
diff --git a/playbooks/rxe.yml b/playbooks/rxe.yml
index 2204b10c136d5b2e0eb0e3262a9f2491fefdfce8..bf991c99f7204346daeed3094e5f595d2a2c00a9 100644
--- a/playbooks/rxe.yml
+++ b/playbooks/rxe.yml
@@ -1,5 +1,5 @@
---
- name: rxe
- hosts: all
+ hosts: all:!localhost
roles:
- role: rxe
diff --git a/playbooks/selftests.yml b/playbooks/selftests.yml
index 2de584cb3c22ac08fa2d675ee5ef504671e8a389..bcfaa0ec02ab0de90d86443633b19933c8f65606 100644
--- a/playbooks/selftests.yml
+++ b/playbooks/selftests.yml
@@ -1,5 +1,5 @@
---
- name: selftests
- hosts: all
+ hosts: all:!localhost
roles:
- role: selftests
diff --git a/playbooks/siw.yml b/playbooks/siw.yml
index cc546919681a15dff2a82472e1889711301b7a5c..83870ee1f8ee6c836964d96076dd89200466573c 100644
--- a/playbooks/siw.yml
+++ b/playbooks/siw.yml
@@ -1,5 +1,5 @@
---
- name: siw
- hosts: all
+ hosts: all:!localhost
roles:
- role: siw
diff --git a/playbooks/smbd.yml b/playbooks/smbd.yml
index 258edec6c5889b2a98a450d230b07a684b28568a..61fa66998fb8e6dd0b8264e08b5fd01ce35c83da 100644
--- a/playbooks/smbd.yml
+++ b/playbooks/smbd.yml
@@ -1,5 +1,5 @@
---
- name: smbd
- hosts: all
+ hosts: all:!localhost
roles:
- role: smbd
diff --git a/playbooks/sysbench.yml b/playbooks/sysbench.yml
index 9cc043ba9d7a67f44d5b297dc8d0ea9cbe6b89ae..0904a0f8a91a6223774592136402f8dceaba2a8d 100644
--- a/playbooks/sysbench.yml
+++ b/playbooks/sysbench.yml
@@ -1,5 +1,5 @@
---
- name: sysbench
- hosts: all
+ hosts: all:!localhost
roles:
- role: sysbench
diff --git a/playbooks/terraform.yml b/playbooks/terraform.yml
index 1d212bd143ab49cc68b919022e8971d64c30270b..f140da906f2f1e0806250d4c51a457e2722a0851 100644
--- a/playbooks/terraform.yml
+++ b/playbooks/terraform.yml
@@ -1,6 +1,6 @@
---
- name: terraform
- hosts: all
+ hosts: all:!localhost
gather_facts: false
roles:
- role: terraform
diff --git a/playbooks/update_etc_hosts.yml b/playbooks/update_etc_hosts.yml
index 57d921ff627a6ffe798dfe90b49b769cd46fe62c..d1c8d5926b7a4344b124b14a66fb972484a3efe2 100644
--- a/playbooks/update_etc_hosts.yml
+++ b/playbooks/update_etc_hosts.yml
@@ -1,6 +1,6 @@
---
- name: update_etc_hosts
- hosts: all
+ hosts: all:!localhost
gather_facts: no
roles:
- role: update_etc_hosts
diff --git a/scripts/guestfs.Makefile b/scripts/guestfs.Makefile
index 8d4aac3e36694f5f4c3f0b040fa5bf6600641be2..39ff06efae31e4ff6a8fe23bfa2fbb11707f97a8 100644
--- a/scripts/guestfs.Makefile
+++ b/scripts/guestfs.Makefile
@@ -64,7 +64,7 @@ $(KDEVOPS_PROVISIONED_SSH):
LIBVIRT_DEFAULT_URI=$(CONFIG_LIBVIRT_URI) \
$(TOPDIR)/scripts/update_ssh_config_guestfs.py; \
fi
- $(Q)ansible $(ANSIBLE_VERBOSE) -i hosts all -m wait_for_connection
+ $(Q)ansible $(ANSIBLE_VERBOSE) -i hosts 'all:!localhost' -m wait_for_connection
$(Q)touch $(KDEVOPS_PROVISIONED_SSH)
install_libguestfs:
diff --git a/workflows/linux/Makefile b/workflows/linux/Makefile
index ecce273a4f67959fb01caaf51e909c55fa3680eb..4d208e3e2de3d40e87df1e4d06a46723d05fb4da 100644
--- a/workflows/linux/Makefile
+++ b/workflows/linux/Makefile
@@ -157,7 +157,7 @@ linux-reboot:
PHONY += uname
uname:
- $(Q)ansible all -i hosts -b -m command -a "uname -r" -o \
+ $(Q)ansible 'all:!localhost' -i hosts -b -m command -a "uname -r" -o \
| awk -F '|' '{gsub(/^ +| +$$/, "", $$2); printf "%-30s %s\n", $$1, $$4}' \
| sed -e 's|(stdout)||'
--
2.49.0
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH 8/8] Makefile: use inventory from ansible.cfg
2025-05-01 18:35 [PATCH 0/8] Define Ansible inventory in the Ansible Configuration file Daniel Gomez
` (6 preceding siblings ...)
2025-05-01 18:35 ` [PATCH 7/8] gen_hosts: templates: add localhost to all hosts Daniel Gomez
@ 2025-05-01 18:35 ` Daniel Gomez
2025-05-02 16:34 ` [PATCH 0/8] Define Ansible inventory in the Ansible Configuration file Luis Chamberlain
8 siblings, 0 replies; 20+ messages in thread
From: Daniel Gomez @ 2025-05-01 18:35 UTC (permalink / raw)
To: Luis Chamberlain, Chuck Lever; +Cc: kdevops, Daniel Gomez, Daniel Gomez
From: Daniel Gomez <da.gomez@samsung.com>
We can define the Ansible inventory via ansible.cfg inventory variable.
Make use of it and remove all the -i/--inventory arguments in all the
ansible-playbook calls.
Target control is now handled in 2 different ways:
- At playbook (hosts: <targets>): E.g. all, all!localhost (all targets
except localhost), localhost. An alternative to all!localhost is to
define all the groups such as baseline,dev. The former option was chosen
for brevity.
So, most of the playbooks have been converted from all ->
all!localhosts. Except for bootlinux playbook, where all is kept as
the playbook runs limited to localhost in linux-clone-9p and limited to
all:!localhosts for the rest of the targets.
- At command line: ansible-playbook --limit 'SUBSET'. In order to
control the hosts when the playbook defines something wider (such as the
case where we want to run only on baseline targets for example), we use
the ansible-playbook argument --limit.
Use --limits argument with the proper syntax [1]: with quotes and colons
(for list of targets or group of targets).
[1]
https://docs.ansible.com/ansible/latest/inventory_guide/intro_patterns.html
Signed-off-by: Daniel Gomez <da.gomez@samsung.com>
---
Makefile | 19 +++-----
Makefile.btrfs_progs | 4 +-
Makefile.build_qemu | 12 ++---
Makefile.hypervisor-tunings | 3 +-
Makefile.kdevops | 19 +++-----
Makefile.linux-mirror | 6 +--
Makefile.postfix | 3 +-
playbooks/roles/gen_hosts/defaults/main.yml | 1 -
playbooks/roles/gen_hosts/tasks/main.yml | 52 ++++++++++-----------
playbooks/roles/update_etc_hosts/tasks/main.yml | 2 +-
scripts/archive.Makefile | 3 +-
scripts/devconfig.Makefile | 8 ++--
scripts/dynamic-pci-kconfig.Makefile | 3 +-
scripts/firstconfig.Makefile | 5 +-
scripts/gen-hosts.Makefile | 1 -
scripts/guestfs.Makefile | 17 +++----
| 3 +-
scripts/iscsi.Makefile | 2 +-
scripts/journal-server.Makefile | 23 ++++++----
scripts/kotd.Makefile | 16 ++++---
scripts/krb5.Makefile | 4 +-
scripts/ktls.Makefile | 1 -
scripts/nfsd.Makefile | 2 +-
scripts/provision.Makefile | 5 +-
scripts/rdma.Makefile | 2 -
scripts/smbd.Makefile | 2 +-
scripts/systemd-timesync.Makefile | 8 ++--
scripts/terraform.Makefile | 6 +--
scripts/update_etc_hosts.Makefile | 2 +-
scripts/vagrant.Makefile | 10 ++--
scripts/workflows/lib/crash.py | 4 +-
workflows/blktests/Makefile | 20 +++++---
workflows/common/Makefile | 2 +-
workflows/cxl/Makefile | 14 +++---
workflows/demos/reboot-limit/Makefile | 32 ++++++++-----
workflows/fstests/Makefile | 40 ++++++++++------
workflows/gitr/Makefile | 8 ++--
workflows/linux/Makefile | 61 ++++++++++++++++---------
workflows/ltp/Makefile | 8 ++--
workflows/nfstest/Makefile | 8 ++--
workflows/pynfs/Makefile | 12 ++---
workflows/selftests/Makefile | 11 +++--
workflows/sysbench/Makefile | 12 ++---
43 files changed, 246 insertions(+), 230 deletions(-)
diff --git a/Makefile b/Makefile
index 7d522d5f918cf81da6fec9258c8c174e48fed11a..eb748b0d815696c69e799260adf5e18e61e4c939 100644
--- a/Makefile
+++ b/Makefile
@@ -15,7 +15,6 @@ include Makefile.subtrees
export KDEVOPS_EXTRA_VARS ?= extra_vars.yaml
export KDEVOPS_PLAYBOOKS_DIR := playbooks
-export KDEVOPS_HOSTFILE ?= hosts
export KDEVOPS_NODES :=
export KDEVOPS_VAGRANT :=
export PYTHONUNBUFFERED=1
@@ -79,8 +78,7 @@ CFLAGS += $(INCLUDES)
ANSIBLE_EXTRA_ARGS += kdevops_version='$(PROJECTRELEASE)'
-export KDEVOPS_HOSTS_TEMPLATE := $(KDEVOPS_HOSTFILE).j2
-export KDEVOPS_HOSTS := $(KDEVOPS_HOSTFILE)
+export KDEVOPS_HOSTS_TEMPLATE := hosts.j2
LOCAL_DEVELOPMENT_ARGS :=
ifeq (y,$(CONFIG_NEEDS_LOCAL_DEVELOPMENT_PATH))
@@ -198,8 +196,7 @@ include scripts/gen-nodes.Makefile
PHONY += ansible.cfg
ansible.cfg:
- @$(Q)ansible-playbook $(ANSIBLE_VERBOSE) --connection=local \
- --inventory localhost, \
+ @$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
$(KDEVOPS_PLAYBOOKS_DIR)/ansible_cfg.yml \
--extra-vars=@./.extra_vars_auto.yaml
@@ -227,17 +224,15 @@ ifneq (,$(KDEVOPS_BRING_UP_DEPS))
include scripts/bringup.Makefile
endif
-DEFAULT_DEPS += $(KDEVOPS_HOSTS)
-$(KDEVOPS_HOSTS): .config ansible.cfg $(KDEVOPS_HOSTS_TEMPLATE)
- $(Q)ansible-playbook $(ANSIBLE_VERBOSE) --connection=local \
- --inventory localhost, \
+DEFAULT_DEPS += inventory
+inventory: .config ansible.cfg $(KDEVOPS_HOSTS_TEMPLATE)
+ $(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
$(KDEVOPS_PLAYBOOKS_DIR)/gen_hosts.yml \
--extra-vars=@./extra_vars.yaml
DEFAULT_DEPS += $(KDEVOPS_NODES)
$(KDEVOPS_NODES) $(KDEVOPS_VAGRANT): .config ansible.cfg $(KDEVOPS_NODES_TEMPLATE)
- $(Q)ansible-playbook $(ANSIBLE_VERBOSE) --connection=local \
- --inventory localhost, \
+ $(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
$(KDEVOPS_PLAYBOOKS_DIR)/gen_nodes.yml \
--extra-vars=@./extra_vars.yaml
@@ -263,7 +258,7 @@ mrproper:
$(Q)rm -f terraform/*/terraform.tfvars
$(Q)rm -rf terraform/*/.terraform
$(Q)rm -f $(KDEVOPS_NODES)
- $(Q)rm -f $(KDEVOPS_HOSTFILE) $(KDEVOPS_MRPROPER)
+ $(Q)rm -f $(CONFIG_ANSIBLE_CFG_INVENTORY) $(KDEVOPS_MRPROPER)
$(Q)rm -f .config .config.old extra_vars.yaml $(KCONFIG_YAMLCFG)
$(Q)rm -f ansible.cfg
$(Q)rm -f playbooks/secret.yml $(KDEVOPS_EXTRA_ADDON_DEST)
diff --git a/Makefile.btrfs_progs b/Makefile.btrfs_progs
index 73a1c95f169a67637cc65febf417b61b967e4668..9ccfafa360eab112e13588ab1908209f62247406 100644
--- a/Makefile.btrfs_progs
+++ b/Makefile.btrfs_progs
@@ -5,8 +5,8 @@ BTRFS_PROGS_SETUP_ARGS += btrfs_progs_build=True
PHONY += btrfs-progs
btrfs-progs: $(KDEVOPS_NODES)
- $(Q)ansible-playbook $(ANSIBLE_VERBOSE) -i \
- $(KDEVOPS_HOSTFILE) $(KDEVOPS_PLAYBOOKS_DIR)/btrfs-progs.yml \
+ $(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
+ $(KDEVOPS_PLAYBOOKS_DIR)/btrfs-progs.yml \
--extra-vars=$(BTRFS_PROGS_SETUP_ARGS) $(LIMIT_HOSTS)
btrfs-progs-help-menu:
diff --git a/Makefile.build_qemu b/Makefile.build_qemu
index 72e1cba4dfbccccf8c546c613b788a26be86ee3f..2eac6e9b56f7f9c67dbff079309b97fab52bee3e 100644
--- a/Makefile.build_qemu
+++ b/Makefile.build_qemu
@@ -20,29 +20,25 @@ QEMU_BUILD_SETUP_ARGS += qemu_target="ppc64-softmmu"
endif
qemu: $(KDEVOPS_EXTRA_VARS)
- $(Q)ansible-playbook $(ANSIBLE_VERBOSE) --connection=local \
- --inventory localhost, \
+ $(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
$(KDEVOPS_PLAYBOOKS_DIR)/build_qemu.yml \
--extra-vars=@./extra_vars.yaml
PHONY += qemu
qemu-install: $(KDEVOPS_EXTRA_VARS)
- $(Q)ansible-playbook $(ANSIBLE_VERBOSE) --connection=local \
- --inventory localhost, \
+ $(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
$(KDEVOPS_PLAYBOOKS_DIR)/build_qemu.yml \
--extra-vars=@./extra_vars.yaml --tags vars,install
PHONY += qemu-install
qemu-configure: $(KDEVOPS_EXTRA_VARS)
- $(Q)ansible-playbook $(ANSIBLE_VERBOSE) --connection=local \
- --inventory localhost, \
+ $(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
$(KDEVOPS_PLAYBOOKS_DIR)/build_qemu.yml \
--extra-vars=@./extra_vars.yaml --tags vars,configure
PHONY += qemu-configure
qemu-build: $(KDEVOPS_EXTRA_VARS)
- $(Q)ansible-playbook $(ANSIBLE_VERBOSE) --connection=local \
- --inventory localhost, \
+ $(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
$(KDEVOPS_PLAYBOOKS_DIR)/build_qemu.yml \
--extra-vars=@./extra_vars.yaml --tags vars,build
PHONY += qemu-build
diff --git a/Makefile.hypervisor-tunings b/Makefile.hypervisor-tunings
index 39547c02f1b68a5bfb4ea770f37e4d3563109532..ff29b89cfbc93c0d5416e8c4bdf6842cbfd2d697 100644
--- a/Makefile.hypervisor-tunings
+++ b/Makefile.hypervisor-tunings
@@ -14,8 +14,7 @@ HYPERVISOR_TUNING_ARGS += hypervisor_tunning_zswap_max_pool_percent=$(ZSWAP_MAX_
endif
kdevops_hypervisor_tunning: $(KDEVOPS_EXTRA_VARS)
- $(Q)ansible-playbook $(ANSIBLE_VERBOSE) --connection=local \
- --inventory localhost, \
+ $(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
$(KDEVOPS_PLAYBOOKS_DIR)/hypervisor-tuning.yml \
--extra-vars=@./extra_vars.yaml
PHONY += kdevops_hypervisor_tunning
diff --git a/Makefile.kdevops b/Makefile.kdevops
index 60d79a5a3e48e25fbda6647e86abc25fcd5611f3..7a156312176048edf37e903323a01c48a642d2f2 100644
--- a/Makefile.kdevops
+++ b/Makefile.kdevops
@@ -2,26 +2,22 @@
# allow your project to define these and just include this file.
KDEVOPS_TERRAFORM_DIR ?= terraform
KDEVOPS_PLAYBOOKS_DIR ?= playbooks
-KDEVOPS_HOSTFILE ?= hosts
KDEVOPS_LOCAL_WORK :=
kdevops_all: kdevops_deps
PHONY := kdevops_all
kdevops_terraform_deps:
- $(Q)ansible-playbook $(ANSIBLE_VERBOSE) --connection=local \
- --inventory localhost, \
+ $(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
$(KDEVOPS_PLAYBOOKS_DIR)/install_terraform.yml
PHONY += kdevops_terraform_deps
kdevops_install_libvirt:
- $(Q)ansible-playbook $(ANSIBLE_VERBOSE) --connection=local \
- --inventory localhost, \
+ $(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
$(KDEVOPS_PLAYBOOKS_DIR)/libvirt_user.yml -e "skip_configuration=True"
kdevops_configure_libvirt:
- $(Q)ansible-playbook $(ANSIBLE_VERBOSE) --connection=local \
- --inventory localhost, \
+ $(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
$(KDEVOPS_PLAYBOOKS_DIR)/libvirt_user.yml -e "skip_install=True" \
-e 'running_user=$(USER)'
@@ -33,23 +29,20 @@ PHONY += kdevops_vagrant_deps
KDEVOPS_VAGRANT_WORK := kdevops_vagrant_deps
kdevops_vagrant_boxes:
- $(Q)ansible-playbook $(ANSIBLE_VERBOSE) --connection=local \
- --inventory localhost, \
+ $(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
$(KDEVOPS_PLAYBOOKS_DIR)/install_vagrant_boxes.yml
PHONY += kdevops_vagrant_boxes
KDEVOPS_VAGRANT_WORK += kdevops_vagrant_boxes
kdevops_verify_libvirt_user:
- $(Q)ansible-playbook $(ANSIBLE_VERBOSE) --connection=local \
- --inventory localhost, \
+ $(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
$(KDEVOPS_PLAYBOOKS_DIR)/libvirt_user.yml -e "only_verify_user=True"
PHONY += kdevops_verify_libvirt_user
KDEVOPS_VAGRANT_WORK += kdevops_verify_libvirt_user
kdevops_libvirt_storage_pool_create:
- $(Q)ansible-playbook $(ANSIBLE_VERBOSE) --connection=local \
- --inventory localhost, \
+ $(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
$(KDEVOPS_PLAYBOOKS_DIR)/libvirt_storage_pool_create.yml
PHONY += kdevops_libvirt_storage_pool_create
diff --git a/Makefile.linux-mirror b/Makefile.linux-mirror
index 6961a55b47ce0796b39841ae125f52f07f11a96f..ccda361ba17396aad80c5cf846a5a21ec155450b 100644
--- a/Makefile.linux-mirror
+++ b/Makefile.linux-mirror
@@ -25,8 +25,7 @@ endif
MIRROR_CODE := $(TOPDIR)/playbooks/roles/linux-mirror/linux-mirror-systemd/
kdevops_linux_mirror: $(KDEVOPS_EXTRA_VARS)
- $(Q)ansible-playbook --connection=local \
- --inventory localhost, \
+ $(Q)ansible-playbook \
--tags vars,mirror \
$(KDEVOPS_PLAYBOOKS_DIR)/linux-mirror.yml \
--extra-vars=@./extra_vars.yaml
@@ -37,8 +36,7 @@ mirror: $(KDEVOPS_EXTRA_VARS) kdevops_linux_mirror
PHONY += mirror
mirror-status: $(KDEVOPS_EXTRA_VARS)
- $(Q)ansible-playbook --connection=local \
- --inventory localhost, \
+ $(Q)ansible-playbook \
--tags vars,mirror-status \
$(KDEVOPS_PLAYBOOKS_DIR)/linux-mirror.yml \
--extra-vars=@./extra_vars.yaml
diff --git a/Makefile.postfix b/Makefile.postfix
index 5db23dc973711dfbd697d5b353e64e257c8f1d0d..704c71550bd0cc0f724aaef2e64db071ca99e92e 100644
--- a/Makefile.postfix
+++ b/Makefile.postfix
@@ -7,8 +7,7 @@ POSTFIX_SETUP_ARGS += postfix_relay_host_setup=True
POSTFIX_SETUP_ARGS += postfix_relay_host=$(POSTFIX_RELAY_HOST)
kdevops_postfix_setup_relay: $(KDEVOPS_EXTRA_VARS)
- $(Q)ansible-playbook $(ANSIBLE_VERBOSE) --connection=local \
- --inventory localhost, \
+ $(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
$(KDEVOPS_PLAYBOOKS_DIR)/postfix_relay_host.yml \
--extra-vars=@./extra_vars.yaml
PHONY += kdevos_postfix_setup_relay
diff --git a/playbooks/roles/gen_hosts/defaults/main.yml b/playbooks/roles/gen_hosts/defaults/main.yml
index f6ab9bcce1669b28bb04f8139f07e3d8091a2a88..1a2f737a63462ce90b868578577f7d1f1575e05c 100644
--- a/playbooks/roles/gen_hosts/defaults/main.yml
+++ b/playbooks/roles/gen_hosts/defaults/main.yml
@@ -6,7 +6,6 @@ hosts_type_generic: True
hosts_type_fs: False
hosts_type_block: False
-kdevops_hosts: "hosts"
kdevops_hosts_template: "hosts.in"
kdevops_playbooks_dir: "/dev/null"
kdevops_genhosts_templates_dir: "/dev/null"
diff --git a/playbooks/roles/gen_hosts/tasks/main.yml b/playbooks/roles/gen_hosts/tasks/main.yml
index a50355f721606a7da961b54ec29b16875391eca9..d20e48998a7789721eb919756755e79e7370ead7 100644
--- a/playbooks/roles/gen_hosts/tasks/main.yml
+++ b/playbooks/roles/gen_hosts/tasks/main.yml
@@ -18,23 +18,23 @@
command: "id -g -n"
register: my_group
-- name: Check if the file {{ kdevops_hosts }} exists already
+- name: Check if the inventory file exists already
stat:
- path: "{{ topdir_path }}/{{ kdevops_hosts }}"
+ path: "{{ ansible_cfg_inventory }}"
register: kdevops_hosts_dest
-- name: Ensure proper permission on the file {{ kdevops_hosts }}
+- name: Ensure proper permission on the inventory file
become: yes
become_flags: 'su - -c'
become_method: sudo
file:
- path: "{{ topdir_path }}/{{ kdevops_hosts }}"
+ path: "{{ ansible_cfg_inventory }}"
owner: "{{ my_user.stdout }}"
group: "{{ my_group.stdout }}"
when:
- kdevops_hosts_dest.stat.exists
-- name: Verify Ansible host template file exists {{ kdevops_hosts_template_full_path }}
+- name: Verify Ansible inventory template file exists
stat:
path: "{{ kdevops_hosts_template_full_path }}"
register: ansible_hosts_template
@@ -56,11 +56,11 @@
when:
- is_fstests
-- name: Generate the Ansible hosts file
+- name: Generate the Ansible inventory file
tags: [ 'hosts' ]
template:
src: "{{ kdevops_hosts_template }}"
- dest: "{{ topdir_path }}/{{ kdevops_hosts }}"
+ dest: "{{ ansible_cfg_inventory }}"
force: yes
trim_blocks: True
lstrip_blocks: True
@@ -68,11 +68,11 @@
- not kdevops_workflows_dedicated_workflow
- ansible_hosts_template.stat.exists
-- name: Generate the Ansible hosts file for dedicated cxl work
+- name: Generate the Ansible inventory file for dedicated cxl work
tags: [ 'hosts' ]
template:
src: "{{ kdevops_hosts_template }}"
- dest: "{{ topdir_path }}/{{ kdevops_hosts }}"
+ dest: "{{ anisble_cfg_inventory }}"
force: yes
trim_blocks: True
lstrip_blocks: True
@@ -81,11 +81,11 @@
- kdevops_workflow_enable_cxl
- ansible_hosts_template.stat.exists
-- name: Generate the Ansible hosts file for dedicated pynfs work
+- name: Generate the Ansible inventory file for dedicated pynfs work
tags: [ 'hosts' ]
template:
src: "{{ kdevops_hosts_template }}"
- dest: "{{ topdir_path }}/{{ kdevops_hosts }}"
+ dest: "{{ ansible_cfg_inventory }}"
force: yes
trim_blocks: True
lstrip_blocks: True
@@ -94,13 +94,13 @@
- kdevops_workflow_enable_pynfs
- ansible_hosts_template.stat.exists
-- name: Generate the Ansible hosts file for dedicated gitr workflow
+- name: Generate the Ansible inventory file for dedicated gitr workflow
tags: [ 'hosts' ]
vars:
gitr_enabled_hosts: "{{ gitr_enabled_test_groups|ansible.builtin.split }}"
template:
src: "{{ kdevops_hosts_template }}"
- dest: "{{ topdir_path }}/{{ kdevops_hosts }}"
+ dest: "{{ ansible_cfg_inventory }}"
force: true
trim_blocks: true
lstrip_blocks: true
@@ -109,13 +109,13 @@
- kdevops_workflow_enable_gitr
- ansible_hosts_template.stat.exists
-- name: Generate an Ansible hosts file for a dedicated ltp workflow
+- name: Generate an Ansible inventory file for a dedicated ltp workflow
tags: [ 'hosts' ]
vars:
ltp_enabled_hosts: "{{ ltp_enabled_test_groups|ansible.builtin.split }}"
ansible.builtin.template:
src: "{{ kdevops_hosts_template }}"
- dest: "{{ topdir_path }}/{{ kdevops_hosts }}"
+ dest: "{{ ansible_cfg_inventory }}"
force: yes
trim_blocks: True
lstrip_blocks: True
@@ -124,13 +124,13 @@
- kdevops_workflow_enable_ltp
- ansible_hosts_template.stat.exists
-- name: Generate the Ansible hosts file for dedicated nfstest workflow
+- name: Generate the Ansible inventory file for dedicated nfstest workflow
tags: [ 'hosts' ]
vars:
nfstest_enabled_hosts: "{{ nfstest_enabled_test_groups | ansible.builtin.split }}"
template:
src: "{{ kdevops_hosts_template }}"
- dest: "{{ topdir_path }}/{{ kdevops_hosts }}"
+ dest: "{{ ansible_cfg_inventory }}"
force: true
trim_blocks: true
lstrip_blocks: true
@@ -183,7 +183,7 @@
- ansible_hosts_template.stat.exists
- item.changed
-- name: Generate the Ansible hosts file for a dedicated fstests setup
+- name: Generate the Ansible inventory file for a dedicated fstests setup
tags: [ 'hosts' ]
vars:
fs_config_data: "{{ lookup('file', fs_config_path) }}"
@@ -194,7 +194,7 @@
sections: "{{ sections_replace_underscore | replace(\"'\", '') | split(', ') }}"
template:
src: "{{ kdevops_hosts_template }}"
- dest: "{{ topdir_path }}/{{ kdevops_hosts }}"
+ dest: "{{ ansible_cfg_inventory }}"
force: yes
trim_blocks: True
lstrip_blocks: True
@@ -224,11 +224,11 @@
- kdevops_workflow_enable_blktests
- ansible_hosts_template.stat.exists
-- name: Generate the Ansible hosts file for a dedicated blktests setup
+- name: Generate the Ansible inventory file for a dedicated blktests setup
tags: [ 'hosts' ]
template:
src: "{{ kdevops_hosts_template }}"
- dest: "{{ topdir_path }}/{{ kdevops_hosts }}"
+ dest: "{{ ansible_cfg_inventory }}"
force: yes
trim_blocks: True
lstrip_blocks: True
@@ -250,11 +250,11 @@
- kdevops_workflow_enable_selftests
- ansible_hosts_template.stat.exists
-- name: Generate the Ansible hosts file for a dedicated selftests setup
+- name: Generate the Ansible inventory file for a dedicated selftests setup
tags: [ 'hosts' ]
template:
src: "{{ kdevops_hosts_template }}"
- dest: "{{ topdir_path }}/{{ kdevops_hosts }}"
+ dest: "{{ ansible_cfg_inventory }}"
force: yes
trim_blocks: True
lstrip_blocks: True
@@ -291,11 +291,11 @@
- kdevops_workflows_dedicated_workflow
- kdevops_workflow_enable_sysbench
-- name: Generate the Ansible hosts file for a dedicated sysbench setup
+- name: Generate the Ansible inventory file for a dedicated sysbench setup
tags: [ 'hosts' ]
template:
src: "{{ kdevops_hosts_template }}"
- dest: "{{ topdir_path }}/{{ kdevops_hosts }}"
+ dest: "{{ ansible_cfg_inventory }}"
force: yes
trim_blocks: True
lstrip_blocks: True
@@ -306,7 +306,7 @@
- name: Verify if final host file exists
stat:
- path: "{{ topdir_path }}/{{ kdevops_hosts }}"
+ path: "{{ ansible_cfg_inventory }}"
register: final_hosts_file
- name: Fail if the dedicated workflow has no rules for node configuration for hosts file configuration
diff --git a/playbooks/roles/update_etc_hosts/tasks/main.yml b/playbooks/roles/update_etc_hosts/tasks/main.yml
index 4c1307fb7c62c9e8db0bceb9847081c330f49f53..2b9af91debb601637ff8fc9cc82fd4a41bb2f5c9 100644
--- a/playbooks/roles/update_etc_hosts/tasks/main.yml
+++ b/playbooks/roles/update_etc_hosts/tasks/main.yml
@@ -26,7 +26,7 @@
- name: Build list of hosts
set_fact:
- ueh_hosts: "{{ groups.all | flatten(levels=1) | reject('eq', inventory_hostname) }}"
+ ueh_hosts: "{{ ansible_play_hosts_all | difference([inventory_hostname]) }}"
- debug:
var: ueh_hosts
diff --git a/scripts/archive.Makefile b/scripts/archive.Makefile
index 54928d328472bb89e03ea0b11c259dbfabbe1c09..23a693d793f3c0659b6f42bc5eb222c560d1d37b 100644
--- a/scripts/archive.Makefile
+++ b/scripts/archive.Makefile
@@ -13,8 +13,7 @@ ARCHIVE_DYNAMIC_RUNTIME_VARS += \
endif
ci-archive:
- $(Q)ansible-playbook $(ANSIBLE_VERBOSE) --connection=local \
- --inventory localhost, \
+ $(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
playbooks/kdevops_archive.yml \
--extra-vars '{ $(ARCHIVE_DYNAMIC_RUNTIME_VARS) }' \
--extra-vars=@./extra_vars.yaml
diff --git a/scripts/devconfig.Makefile b/scripts/devconfig.Makefile
index bdff088589cd240717023f79d7adf349f196a463..7b80db0aa910193068de3f6e57205e4b2c5f9856 100644
--- a/scripts/devconfig.Makefile
+++ b/scripts/devconfig.Makefile
@@ -56,8 +56,8 @@ extend-extra-args-devconfig:
PHONY += devconfig
devconfig: $(KDEVOPS_NODES)
- $(Q)ansible-playbook $(ANSIBLE_VERBOSE) -i $(KDEVOPS_HOSTFILE) \
- -l all,nfsd \
+ $(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
+ --limit 'all:!localhost' \
$(KDEVOPS_PLAYBOOKS_DIR)/devconfig.yml \
--extra-vars="$(BOOTLINUX_ARGS)" \
--extra-vars '{ kdevops_cli_install: True }' \
@@ -71,8 +71,8 @@ HELP_TARGETS+=devconfig-generic-help-menu
ifeq (y,$(CONFIG_SYSCTL_TUNING))
PHONY += sysctl-tunings
sysctl-tunings: $(KDEVOPS_NODES)
- $(Q)ansible-playbook $(ANSIBLE_VERBOSE) -i $(KDEVOPS_HOSTFILE) \
- -l all,nfsd \
+ $(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
+ --limit 'all:!localhost' \
$(KDEVOPS_PLAYBOOKS_DIR)/devconfig.yml \
--extra-vars="$(BOOTLINUX_ARGS)" $(LIMIT_HOSTS) --tags vars,sysctl
diff --git a/scripts/dynamic-pci-kconfig.Makefile b/scripts/dynamic-pci-kconfig.Makefile
index 716cdc1e4814a26532c8bb3550670cdd1e4caf3a..8902da29e53d8a34df077f72f4969565f867ae3c 100644
--- a/scripts/dynamic-pci-kconfig.Makefile
+++ b/scripts/dynamic-pci-kconfig.Makefile
@@ -42,8 +42,7 @@ endif # CONFIG_KDEVOPS_LIBVIRT_PCIE_PASSTHROUGH
HELP_TARGETS += dynamic-kconfig-pci-help
dynamic_pcipassthrough_kconfig:
- $(Q)ansible-playbook $(ANSIBLE_VERBOSE) --connection=local \
- --inventory localhost, \
+ $(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
playbooks/gen-pci-kconfig.yml \
--extra-vars '{ $(PCIE_RUNTIME_VARS) }'
diff --git a/scripts/firstconfig.Makefile b/scripts/firstconfig.Makefile
index f1a4423e6d96f551f2ae8652fa2f8a08bc06fce8..9f8a63a8ff849decf2256a24d3c756664ef07d61 100644
--- a/scripts/firstconfig.Makefile
+++ b/scripts/firstconfig.Makefile
@@ -1,8 +1,9 @@
# SPDX-License-Identifier: copyleft-next-0.3.1
firstconfig:
- $(Q)ansible-playbook $(ANSIBLE_VERBOSE) -l baseline,dev \
- -i hosts --extra-vars '{ kdevops_cli_install: True }' \
+ $(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
+ --limit 'baseline:dev' \
+ --extra-vars '{ kdevops_cli_install: True }' \
--tags vars_simple,firstconfig \
$(KDEVOPS_PLAYBOOKS_DIR)/devconfig.yml
diff --git a/scripts/gen-hosts.Makefile b/scripts/gen-hosts.Makefile
index 84e47fd73c9b716abd9b2e4ba52aa548dc6e59d8..0d1e0cd77c2ed92b5df678012e292ff386f3af2e 100644
--- a/scripts/gen-hosts.Makefile
+++ b/scripts/gen-hosts.Makefile
@@ -4,7 +4,6 @@ KDEVOPS_PLAYBOOKS_DIR_FULL_PATH=$(TOPDIR_PATH)/$(KDEVOPS_PLAYBOOKS_DIR)
KDEVOPS_HOSTS_TEMPLATE_DIR=$(KDEVOPS_PLAYBOOKS_DIR_FULL_PATH)/roles/gen_hosts/templates
GENHOSTS_EXTRA_ARGS += kdevops_playbooks_dir='$(KDEVOPS_PLAYBOOKS_DIR)'
-GENHOSTS_EXTRA_ARGS += kdevops_hosts='$(KDEVOPS_HOSTFILE)'
# Relative path so that ansible can work with it
KDEVOPS_HOSTS_TEMPLATE_SHORT:=$(KDEVOPS_HOSTS_TEMPLATE)
diff --git a/scripts/guestfs.Makefile b/scripts/guestfs.Makefile
index 39ff06efae31e4ff6a8fe23bfa2fbb11707f97a8..60e50b4f93ef1f2158748731e0e86d4d054fbf86 100644
--- a/scripts/guestfs.Makefile
+++ b/scripts/guestfs.Makefile
@@ -51,38 +51,33 @@ KDEVOPS_PROVISION_DESTROY_METHOD := destroy_guestfs
$(Q)make linux-clone
libvirt_pcie_passthrough_permissions:
- $(Q)ansible-playbook $(ANSIBLE_VERBOSE) --connection=local \
- --inventory localhost, \
+ $(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
playbooks/libvirt_pcie_passthrough.yml
$(KDEVOPS_PROVISIONED_SSH):
$(Q)if [[ "$(CONFIG_KDEVOPS_SSH_CONFIG_UPDATE)" == "y" ]]; then \
- ansible-playbook $(ANSIBLE_VERBOSE) --connection=local \
- --inventory localhost, \
+ ansible-playbook $(ANSIBLE_VERBOSE) \
playbooks/update_ssh_config_guestfs.yml \
--extra-vars=@./extra_vars.yaml; \
LIBVIRT_DEFAULT_URI=$(CONFIG_LIBVIRT_URI) \
$(TOPDIR)/scripts/update_ssh_config_guestfs.py; \
fi
- $(Q)ansible $(ANSIBLE_VERBOSE) -i hosts 'all:!localhost' -m wait_for_connection
+ $(Q)ansible $(ANSIBLE_VERBOSE) 'all:!localhost' -m wait_for_connection
$(Q)touch $(KDEVOPS_PROVISIONED_SSH)
install_libguestfs:
- $(Q)ansible-playbook $(ANSIBLE_VERBOSE) --connection=local \
- --inventory localhost, \
+ $(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
playbooks/bringup_guestfs.yml \
--extra-vars=@./extra_vars.yaml \
--tags install-deps
bringup_guestfs: $(GUESTFS_BRINGUP_DEPS)
- $(Q)ansible-playbook $(ANSIBLE_VERBOSE) --connection=local \
- --inventory localhost, \
+ $(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
playbooks/bringup_guestfs.yml \
--extra-vars=@./extra_vars.yaml \
--tags config-check,network,storage-pool-path
$(Q)$(TOPDIR)/scripts/bringup_guestfs.sh
- $(Q)ansible-playbook $(ANSIBLE_VERBOSE) --connection=local \
- --inventory localhost, \
+ $(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
playbooks/bringup_guestfs.yml \
--extra-vars=@./extra_vars.yaml \
--tags console-permissions
--git a/scripts/install-menuconfig-deps.Makefile b/scripts/install-menuconfig-deps.Makefile
index 772e65df2528d1fdd191b7fad4ae68ebe0e35979..4b9aef8db20d63b8ab3ab131bf614ea54b5a6372 100644
--- a/scripts/install-menuconfig-deps.Makefile
+++ b/scripts/install-menuconfig-deps.Makefile
@@ -1,8 +1,7 @@
# SPDX-License-Identifier: copyleft-next-0.3.1
menuconfig-deps:
- $(Q)ansible-playbook $(ANSIBLE_VERBOSE) --connection=local \
- --inventory localhost, \
+ $(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
$(KDEVOPS_PLAYBOOKS_DIR)/install-menuconfig-deps.yml \
-e 'kdevops_first_run=True'
PHONY += menuconfig-deps
diff --git a/scripts/iscsi.Makefile b/scripts/iscsi.Makefile
index d9ac22befa0277c27c19e52ca548f93d0eb18f70..940dce35df54ff7457a13c51cb07b207168128ae 100644
--- a/scripts/iscsi.Makefile
+++ b/scripts/iscsi.Makefile
@@ -7,7 +7,7 @@ ANSIBLE_EXTRA_ARGS += $(ISCSI_EXTRA_ARGS)
iscsi:
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
- -i $(KDEVOPS_HOSTFILE) -l iscsi \
+ --limit 'iscsi' \
--extra-vars=@./extra_vars.yaml \
$(KDEVOPS_PLAYBOOKS_DIR)/iscsi.yml
diff --git a/scripts/journal-server.Makefile b/scripts/journal-server.Makefile
index da61fa30269826088ef261df91a1f9974f3a9493..d3c39712351dd60ed2f2e3dba9201cd8439c7912 100644
--- a/scripts/journal-server.Makefile
+++ b/scripts/journal-server.Makefile
@@ -11,24 +11,26 @@ ANSIBLE_EXTRA_ARGS += devconfig_systemd_journal_use_http='True'
endif
journal-client:
- $(Q)ansible-playbook $(ANSIBLE_VERBOSE) -l baseline,dev \
- -i hosts --extra-vars '{ kdevops_cli_install: True }' \
+ $(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
+ --limit 'baseline:dev' \
+ --extra-vars '{ kdevops_cli_install: True }' \
--tags vars_simple,journal \
$(KDEVOPS_PLAYBOOKS_DIR)/devconfig.yml
journal-server:
- $(Q)ansible-playbook $(ANSIBLE_VERBOSE) --connection=local \
- --inventory localhost, \
+ $(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
$(KDEVOPS_PLAYBOOKS_DIR)/install_systemd_journal_remote.yml
journal-restart:
- $(Q)ansible-playbook $(ANSIBLE_VERBOSE) -l baseline,dev \
- -i hosts --tags vars_extra,journal-upload-restart \
+ $(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
+ --limit 'baseline:dev' \
+ --tags vars_extra,journal-upload-restart \
$(KDEVOPS_PLAYBOOKS_DIR)/devconfig.yml
journal-status:
- $(Q)ansible-playbook $(ANSIBLE_VERBOSE) -l baseline,dev \
- -i hosts --tags vars_extra,journal-status \
+ $(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
+ --limit 'baseline:dev' \
+ --tags vars_extra,journal-status \
$(KDEVOPS_PLAYBOOKS_DIR)/devconfig.yml
journal-ls:
@@ -39,8 +41,9 @@ journal-dump:
journal-ln:
- $(Q)ansible-playbook $(ANSIBLE_VERBOSE) -l baseline,dev \
- -i hosts --tags vars_extra,journal_ln \
+ $(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
+ --limit 'baseline:dev' \
+ --tags vars_extra,journal_ln \
$(KDEVOPS_PLAYBOOKS_DIR)/devconfig.yml
LOCALHOST_SETUP_WORK += journal-server
diff --git a/scripts/kotd.Makefile b/scripts/kotd.Makefile
index b9b7cf650612d0fb4c28475444ca52b866051c45..c74aad5a1a3c208e7ca74822983b6baf18812cea 100644
--- a/scripts/kotd.Makefile
+++ b/scripts/kotd.Makefile
@@ -9,19 +9,23 @@ endif # HAVE_DISTRO_CUSTOM_KOTD_REPO
ANSIBLE_CMD_KOTD_ENABLE :=
-kotd: $(KDEVOPS_HOSTS) .config
+kotd: inventory .config
$(Q)$(ANSIBLE_CMD_KOTD_ENABLE)ansible-playbook $(ANSIBLE_VERBOSE) \
- -i hosts playbooks/devconfig.yml --tags vars,kotd \
+ playbooks/devconfig.yml --tags vars,kotd \
--extra-vars=@./extra_vars.yaml
-kotd-baseline: $(KDEVOPS_HOSTS) .config
+kotd-baseline: inventory .config
$(Q)$(ANSIBLE_CMD_KOTD_ENABLE)ansible-playbook $(ANSIBLE_VERBOSE) \
- -i hosts -l baseline playbooks/devconfig.yml --tags vars,kotd \
+ --limit 'baseline' \
+ playbooks/devconfig.yml \
+ --tags vars,kotd \
--extra-vars=@./extra_vars.yaml
-kotd-dev: $(KDEVOPS_HOSTS) .config
+kotd-dev: inventory .config
$(Q)$(ANSIBLE_CMD_KOTD_ENABLE)ansible-playbook $(ANSIBLE_VERBOSE) \
- -i hosts -l dev playbooks/devconfig.yml --tags vars,kotd \
+ --limit 'dev' \
+ playbooks/devconfig.yml \
+ --tags vars,kotd \
--extra-vars=@./extra_vars.yaml
kotd-help-menu:
diff --git a/scripts/krb5.Makefile b/scripts/krb5.Makefile
index d49e77ba02a8efcf09b8fbc689abe2a09a39c435..eeadadc519b495aefa7732a529d8d1f650108de7 100644
--- a/scripts/krb5.Makefile
+++ b/scripts/krb5.Makefile
@@ -8,13 +8,13 @@ ANSIBLE_EXTRA_ARGS += $(KRB5_EXTRA_ARGS)
kdc:
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
- -i $(KDEVOPS_HOSTFILE) -l kdc \
+ --limit 'kdc' \
--extra-vars=@./extra_vars.yaml \
$(KDEVOPS_PLAYBOOKS_DIR)/kdc.yml
krb5:
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
- -i $(KDEVOPS_HOSTFILE) -l krb5 \
+ --limit 'krb5' \
--extra-vars=@./extra_vars.yaml \
$(KDEVOPS_PLAYBOOKS_DIR)/krb5.yml
diff --git a/scripts/ktls.Makefile b/scripts/ktls.Makefile
index ee1de731329f47fec26e270acbd215c1aefa6629..83a8dbe6c88df4ce1161bfa827bf86ddb577de71 100644
--- a/scripts/ktls.Makefile
+++ b/scripts/ktls.Makefile
@@ -2,7 +2,6 @@ ifeq (y,$(CONFIG_KDEVOPS_SETUP_KTLS))
ktls:
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
- -i $(KDEVOPS_HOSTFILE) \
--extra-vars=@./extra_vars.yaml \
$(KDEVOPS_PLAYBOOKS_DIR)/ktls.yml
diff --git a/scripts/nfsd.Makefile b/scripts/nfsd.Makefile
index 79b980123591094c18a967e013c543166e886e4b..9779ec56b06d3cc6b1164f0dca0f1b0795169e7d 100644
--- a/scripts/nfsd.Makefile
+++ b/scripts/nfsd.Makefile
@@ -29,7 +29,7 @@ ANSIBLE_EXTRA_ARGS += $(NFSD_EXTRA_ARGS)
nfsd:
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
- -i $(KDEVOPS_HOSTFILE) -l nfsd \
+ --limit 'nfsd' \
--extra-vars=@./extra_vars.yaml \
$(KDEVOPS_PLAYBOOKS_DIR)/nfsd.yml
diff --git a/scripts/provision.Makefile b/scripts/provision.Makefile
index 92a7541089fcea5ae7471a6b49584ab3a3ee4e78..4df632f82f5ea6de0c2b5775c66ec6423a813b89 100644
--- a/scripts/provision.Makefile
+++ b/scripts/provision.Makefile
@@ -69,8 +69,9 @@ KDEVOPS_MRPROPER += $(KDEVOPS_PROVISIONED_DEVCONFIG)
$(KDEVOPS_PROVISIONED_DEVCONFIG):
$(Q)if [[ "$(CONFIG_KDEVOPS_ANSIBLE_PROVISION_PLAYBOOK)" != "" ]]; then \
- ansible-playbook $(ANSIBLE_VERBOSE) -i \
- $(KDEVOPS_HOSTFILE) $(KDEVOPS_PLAYBOOKS_DIR)/$(KDEVOPS_ANSIBLE_PROVISION_PLAYBOOK) ;\
+ ansible-playbook $(ANSIBLE_VERBOSE) \
+ --limit '!localhost' \
+ $(KDEVOPS_PLAYBOOKS_DIR)/$(KDEVOPS_ANSIBLE_PROVISION_PLAYBOOK) ;\
fi
$(Q)touch $(KDEVOPS_PROVISIONED_DEVCONFIG)
diff --git a/scripts/rdma.Makefile b/scripts/rdma.Makefile
index 5c8b60d72f25e5e8a88f1301e1efccb2f2c58a99..c63b63a7c9395d458745a63ba699cf5294875f96 100644
--- a/scripts/rdma.Makefile
+++ b/scripts/rdma.Makefile
@@ -2,7 +2,6 @@ ifeq (y,$(CONFIG_KDEVOPS_SETUP_RDMA_SIW))
siw:
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
- -i $(KDEVOPS_HOSTFILE) \
--extra-vars=@./extra_vars.yaml \
$(KDEVOPS_PLAYBOOKS_DIR)/siw.yml
@@ -16,7 +15,6 @@ ifeq (y,$(CONFIG_KDEVOPS_SETUP_RDMA_RXE))
rxe:
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
- -i $(KDEVOPS_HOSTFILE) \
--extra-vars=@./extra_vars.yaml \
$(KDEVOPS_PLAYBOOKS_DIR)/rxe.yml
diff --git a/scripts/smbd.Makefile b/scripts/smbd.Makefile
index 1be5b93411a5629122de19f4470fbd0d9230a2bf..ba696f7366eb1971aacb5064bd66504041a05756 100644
--- a/scripts/smbd.Makefile
+++ b/scripts/smbd.Makefile
@@ -9,7 +9,7 @@ ANSIBLE_EXTRA_ARGS += $(SMBD_EXTRA_ARGS)
smbd:
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
- -i $(KDEVOPS_HOSTFILE) -l smbd \
+ --limit 'smbd' \
--extra-vars=@./extra_vars.yaml \
$(KDEVOPS_PLAYBOOKS_DIR)/smbd.yml
diff --git a/scripts/systemd-timesync.Makefile b/scripts/systemd-timesync.Makefile
index 9b84b4a1135961ee6feaa22f4c760b2009fd4a6e..148bf1737db42bce077bab215de5c99722ebbd77 100644
--- a/scripts/systemd-timesync.Makefile
+++ b/scripts/systemd-timesync.Makefile
@@ -20,14 +20,14 @@ ANSIBLE_EXTRA_ARGS += devconfig_enable_systemd_timesyncd_ntp_google_debian='True
endif
timesyncd-client:
- $(Q)ansible-playbook $(ANSIBLE_VERBOSE) -l baseline,dev \
- -i hosts --extra-vars '{ kdevops_cli_install: True }' \
+ $(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
+ --limit 'baseline:dev' \
+ --extra-vars '{ kdevops_cli_install: True }' \
--tags vars_simple,timesyncd \
$(KDEVOPS_PLAYBOOKS_DIR)/devconfig.yml
timesyncd-server:
- $(Q)ansible-playbook $(ANSIBLE_VERBOSE) --connection=local \
- --inventory localhost, \
+ $(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
$(KDEVOPS_PLAYBOOKS_DIR)/install_systemd_timesyncd.yml
timesyncd-status:
diff --git a/scripts/terraform.Makefile b/scripts/terraform.Makefile
index 91469469188a4f38b5e4d3c44f8fed449df90881..1032fa638931d45eb91a9861823486395f3ca10c 100644
--- a/scripts/terraform.Makefile
+++ b/scripts/terraform.Makefile
@@ -102,13 +102,11 @@ ANSIBLE_EXTRA_ARGS += $(TERRAFORM_EXTRA_VARS)
bringup_terraform:
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
- --connection=local --inventory localhost, \
playbooks/terraform.yml --tags bringup \
--extra-vars=@./extra_vars.yaml
$(KDEVOPS_PROVISIONED_SSH):
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
- -i $(KDEVOPS_HOSTFILE) \
playbooks/terraform.yml --tags ssh \
--extra-vars=@./extra_vars.yaml
$(Q)touch $(KDEVOPS_PROVISIONED_SSH)
@@ -118,13 +116,11 @@ status_terraform:
destroy_terraform:
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
- --connection=local -i $(KDEVOPS_HOSTFILE) \
playbooks/terraform.yml --tags destroy \
--extra-vars=@./extra_vars.yaml
$(Q)rm -f $(KDEVOPS_PROVISIONED_SSH) $(KDEVOPS_PROVISIONED_DEVCONFIG)
$(KDEVOPS_TFVARS): $(KDEVOPS_TFVARS_TEMPLATE) .config
- $(Q)ansible-playbook $(ANSIBLE_VERBOSE) --connection=local \
- --inventory localhost, \
+ $(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
$(KDEVOPS_PLAYBOOKS_DIR)/gen_tfvars.yml \
--extra-vars=@./extra_vars.yaml
diff --git a/scripts/update_etc_hosts.Makefile b/scripts/update_etc_hosts.Makefile
index 4da15ea528374924b950824999fd6d70b4fd5aba..5fb90e987a32d5ae0449e09a2af5a5854b8a2ba5 100644
--- a/scripts/update_etc_hosts.Makefile
+++ b/scripts/update_etc_hosts.Makefile
@@ -1,6 +1,6 @@
update_etc_hosts:
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
- -i hosts playbooks/update_etc_hosts.yml
+ playbooks/update_etc_hosts.yml
KDEVOPS_BRING_UP_DEPS_EARLY += update_etc_hosts
diff --git a/scripts/vagrant.Makefile b/scripts/vagrant.Makefile
index e43a21d3c056225a0af5c3494cf64e75b648cd56..2c97f466a26127362971da6da0942fbff62a9b8c 100644
--- a/scripts/vagrant.Makefile
+++ b/scripts/vagrant.Makefile
@@ -80,21 +80,19 @@ extend-extra-args-vagrant:
fi
vagrant_private_box_install:
- $(Q)ansible-playbook $(ANSIBLE_VERBOSE) -i \
- $(KDEVOPS_HOSTFILE) $(KDEVOPS_PLAYBOOKS_DIR)/install_vagrant_boxes.yml
+ $(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
+ $(KDEVOPS_PLAYBOOKS_DIR)/install_vagrant_boxes.yml
vagrant_9p_linux_clone:
$(Q)make linux-clone
libvirt_pcie_passthrough_permissions:
- $(Q)ansible-playbook $(ANSIBLE_VERBOSE) --connection=local \
- --inventory localhost, \
+ $(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
playbooks/libvirt_pcie_passthrough.yml
$(KDEVOPS_PROVISIONED_SSH):
$(Q)if [[ "$(CONFIG_KDEVOPS_SSH_CONFIG_UPDATE)" == "y" ]]; then \
- ansible-playbook $(ANSIBLE_VERBOSE) --connection=local \
- --inventory localhost, \
+ ansible-playbook $(ANSIBLE_VERBOSE) \
playbooks/update_ssh_config_vagrant.yml
fi
$(Q)touch $(KDEVOPS_PROVISIONED_SSH)
diff --git a/scripts/workflows/lib/crash.py b/scripts/workflows/lib/crash.py
index 663de9324e87e3103bd9532e9ea6c44e6352d87a..72f506f612ab0897dede07d087426c3e295eba3a 100755
--- a/scripts/workflows/lib/crash.py
+++ b/scripts/workflows/lib/crash.py
@@ -769,9 +769,7 @@ class KernelCrashWatchdog:
subprocess.run(
[
"ansible",
- "-i",
- "hosts",
- "all",
+ "'all:!localhost'",
"-m",
"wait_for_connection",
"-l",
diff --git a/workflows/blktests/Makefile b/workflows/blktests/Makefile
index 33fb6482e2fa70f992893c3a076313992e19ce4f..92c96babccf05508732a976ab93e43a493ed9ba3 100644
--- a/workflows/blktests/Makefile
+++ b/workflows/blktests/Makefile
@@ -67,12 +67,13 @@ extend-extra-args-blktests:
blktests:
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
- -i hosts playbooks/blktests.yml \
+ playbooks/blktests.yml \
--skip-tags run_tests,copy_results $(LIMIT_HOSTS)
blktests-baseline:
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
- -i hosts -l baseline playbooks/blktests.yml \
+ --limit 'baseline' \
+ playbooks/blktests.yml \
--tags run_tests,copy_results \
--extra-vars '{ $(BLKTESTS_DYNAMIC_RUNTIME_VARS) }' \
--extra-vars=@./extra_vars.yaml $(LIMIT_HOSTS)
@@ -85,14 +86,16 @@ blktests-baseline-kernelci:
blktests-baseline-skip-kdevops-update:
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
- -i hosts -l baseline playbooks/blktests.yml \
+ --limit 'baseline' \
+ playbooks/blktests.yml \
--tags run_tests,copy_results --skip-tags git_update \
--extra-vars '{ $(BLKTESTS_DYNAMIC_RUNTIME_VARS) }' \
--extra-vars=@./extra_vars.yaml $(LIMIT_HOSTS)
blktests-baseline-run-oscheck-only:
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
- -i hosts -l baseline playbooks/blktests.yml \
+ --limit 'baseline' \
+ playbooks/blktests.yml \
--tags run_tests,copy_results \
--skip-tags git_update,reboot,clean_results \
--extra-vars '{ $(BLKTESTS_DYNAMIC_RUNTIME_VARS) }' \
@@ -100,14 +103,16 @@ blktests-baseline-run-oscheck-only:
blktests-dev:
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
- -i hosts -l dev playbooks/blktests.yml \
+ --limit 'dev' \
+ playbooks/blktests.yml \
--tags run_tests,copy_results \
--extra-vars '{ $(BLKTESTS_DYNAMIC_RUNTIME_VARS) }' \
--extra-vars=@./extra_vars.yaml $(LIMIT_HOSTS)
blktests-baseline-results:
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
- -i hosts -l baseline playbooks/blktests.yml \
+ --limit 'baseline' \
+ playbooks/blktests.yml \
--tags copy_results,print_results \
--extra-vars '{ kdevops_run_blktests: True }' \
--extra-vars=@./extra_vars.yaml $(LIMIT_HOSTS)
@@ -116,7 +121,8 @@ blktests-results: blktests-baseline-results
blktests-dev-results:
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
- -i hosts -l dev playbooks/blktests.yml \
+ --limit 'dev' \
+ playbooks/blktests.yml \
--tags copy_results,print_results \
--extra-vars '{ kdevops_run_blktests: True }' \
--extra-vars=@./extra_vars.yaml $(LIMIT_HOSTS)
diff --git a/workflows/common/Makefile b/workflows/common/Makefile
index cfbebebd8ce2ced1147d7f9f4982bcdcbce89118..9ae0a0a9aff51276bedcbc3682841d7f7de04168 100644
--- a/workflows/common/Makefile
+++ b/workflows/common/Makefile
@@ -38,7 +38,7 @@ endif # CONFIG_WORKFLOW_INFER_USER_AND_GROUP == y
ifeq (y,$(CONFIG_KDEVOPS_WORKFLOW_GIT_CLONES_KDEVOPS_GIT))
kdevops-git-reset:
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
- -i hosts playbooks/common.yml --tags vars,kdevops_reset \
+ playbooks/common.yml --tags vars,kdevops_reset \
--extra-vars '{ kdevops_git_reset: True }' $(LIMIT_HOSTS)
kdevops-help-menu:
diff --git a/workflows/cxl/Makefile b/workflows/cxl/Makefile
index 11d3e8582b43a7fd13ce07ca626799fffe5168cd..bb13005763f81327a3fa71df2367b8e9418e7428 100644
--- a/workflows/cxl/Makefile
+++ b/workflows/cxl/Makefile
@@ -20,42 +20,42 @@ include $(TOPDIR)/workflows/cxl/Makefile.kernel
cxl:
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
- -i hosts playbooks/cxl.yml \
+ playbooks/cxl.yml \
--skip-tags run_tests,copy_results \
$(LIMIT_HOSTS)
cxl-test-probe:
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
- -i hosts playbooks/cxl.yml \
+ playbooks/cxl.yml \
--tags vars,cxl-test-prep,cxl-test-probe \
--extra-vars '{ $(CXL_DYNAMIC_RUNTIME_VARS) }' \
$(LIMIT_HOSTS)
cxl-test-meson:
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
- -i hosts playbooks/cxl.yml \
+ playbooks/cxl.yml \
--tags vars,cxl-test-prep,cxl-test-meson \
--extra-vars '{ $(CXL_DYNAMIC_RUNTIME_VARS) }' \
$(LIMIT_HOSTS)
cxl-results:
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
- -i hosts playbooks/cxl.yml \
+ playbooks/cxl.yml \
--tags vars,copy_results $(LIMIT_HOSTS)
cxl-mem-setup:
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
- -i hosts playbooks/cxl.yml \
+ playbooks/cxl.yml \
--tags vars,extra-vars,cxl-mem-setup $(LIMIT_HOSTS)
cxl-create-dc-region:
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
- -i hosts playbooks/cxl.yml \
+ playbooks/cxl.yml \
--tags vars,cxl-create-dc-region $(LIMIT_HOSTS)
cxl-dcd-setup:
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
- -i hosts playbooks/cxl.yml \
+ playbooks/cxl.yml \
--tags vars,cxl-dcd-setup $(LIMIT_HOSTS)
cxl-help-menu:
diff --git a/workflows/demos/reboot-limit/Makefile b/workflows/demos/reboot-limit/Makefile
index a6b4aaf788bd2e8fb30922a58c26f2bbe9a69a1e..e4cbf2947164dadc2c7bf4587f4afc6c8c46fdc5 100644
--- a/workflows/demos/reboot-limit/Makefile
+++ b/workflows/demos/reboot-limit/Makefile
@@ -25,7 +25,7 @@ REBOOT_LIMIT_TEST_TYPE :=$(subst ",,$(CONFIG_REBOOT_LIMIT_TEST_TYPE))
# into the file extra_vars.yaml. The extra_vars.yaml file is always used as an
# argument to ansible so that it reads our manually converted kconfig varibles
# in ansible. We typically call a playbook with something like:
-# ansible-playbook -i hosts -l baseline playbooks/foo.yml --tags bar --extra-vars=@./extra_vars.yaml
+# ansible-playbook -l baseline playbooks/foo.yml --tags bar --extra-vars=@./extra_vars.yaml
#
# Likewise most playbooks also have something like the following as their first
# task in their playbooks, so that they don't have to be specifying the
@@ -104,7 +104,7 @@ endif # CONFIG_KERNEL_CI
# with tags "run_tests" or "copy_results".
reboot-limit:
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
- -i hosts playbooks/reboot-limit.yml \
+ playbooks/reboot-limit.yml \
--skip-tags run_tests,copy_results
# kdevops supports generic workflows such as the enabling you to then use the
@@ -134,10 +134,13 @@ reboot-limit:
# fly.
reboot-limit-baseline:
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
- -i hosts -l baseline playbooks/reboot-limit.yml \
- --tags vars,first_run,reset --extra-vars=@./extra_vars.yaml
+ --limit 'baseline' \
+ playbooks/reboot-limit.yml \
+ --tags vars,first_run,reset \
+ --extra-vars=@./extra_vars.yaml
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
- -i hosts -l baseline playbooks/reboot-limit.yml \
+ --limit 'baseline' \
+ playbooks/reboot-limit.yml \
--tags vars,run_tests,copy_results \
--extra-vars=@./extra_vars.yaml
@@ -155,16 +158,21 @@ reboot-limit-baseline-kernelci:
# Resets the boot counters so we start from scratch
reboot-limit-baseline-reset:
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
- -i hosts -l baseline playbooks/reboot-limit.yml \
- --tags vars,reset --extra-vars=@./extra_vars.yaml
+ --limit 'baseline' \
+ playbooks/reboot-limit.yml \
+ --tags vars,reset \
+ --extra-vars=@./extra_vars.yaml
# Below are the corresponding dev targets
reboot-limit-dev-baseline:
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
- -i hosts -l dev playbooks/reboot-limit.yml \
- --tags vars,first_run,reset --extra-vars=@./extra_vars.yaml
+ --limit 'dev' \
+ playbooks/reboot-limit.yml \
+ --tags vars,first_run,reset \
+ --extra-vars=@./extra_vars.yaml
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
- -i hosts -l dev playbooks/reboot-limit.yml \
+ --limit 'dev' \
+ playbooks/reboot-limit.yml \
--tags vars,run_tests,copy_results \
--extra-vars=@./extra_vars.yaml
@@ -176,7 +184,9 @@ reboot-limit-dev-kernelci:
reboot-limit-dev-reset:
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
- -i hosts -l dev playbooks/reboot-limit.yml --tags vars,reset \
+ --limit 'dev' \
+ playbooks/reboot-limit.yml \
+ --tags vars,reset \
--extra-vars=@./extra_vars.yaml
reboot-limit-help-menu:
diff --git a/workflows/fstests/Makefile b/workflows/fstests/Makefile
index a5e307b61b395a5a836d69bd9fea98d5cd49491c..48790d99c1dd6790d87accc56547853bb58a41b7 100644
--- a/workflows/fstests/Makefile
+++ b/workflows/fstests/Makefile
@@ -138,19 +138,22 @@ endif
endif
fstests: $(FSTESTS_BASELINE_EXTRA)
- $(Q)ansible-playbook $(ANSIBLE_VERBOSE) -l localhost,baseline,dev \
- -i hosts playbooks/fstests.yml \
+ $(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
+ --limit 'localhost:baseline:dev' \
+ playbooks/fstests.yml \
--skip-tags run_tests,copy_results $(LIMIT_HOSTS)
fstests-kdevops-setup: $(KDEVOPS_EXTRA_VARS) $(FSTESTS_BASELINE_EXTRA)
- $(Q)ansible-playbook $(ANSIBLE_VERBOSE) -l baseline,dev \
- -i hosts playbooks/fstests.yml \
+ $(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
+ --limit 'baseline:dev' \
+ playbooks/fstests.yml \
--tags vars,kdevops_fstests_setup,gendisks \
$(LIMIT_HOSTS)
fstests-baseline: $(FSTESTS_BASELINE_EXTRA)
$(Q)PYTHONUNBUFFERED=1 ansible-playbook $(ANSIBLE_VERBOSE) \
- -i hosts -l baseline playbooks/fstests.yml \
+ --limit 'baseline' \
+ playbooks/fstests.yml \
--tags vars,run_tests,copy_results \
--extra-vars '{ $(FSTESTS_DYNAMIC_RUNTIME_VARS) }' \
--extra-vars=@./extra_vars.yaml $(LIMIT_HOSTS)
@@ -163,7 +166,8 @@ fstests-baseline-kernelci: $(KDEVOPS_EXTRA_VARS)
fstests-baseline-skip-kdevops-update: $(KDEVOPS_EXTRA_VARS)
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
- -i hosts -l baseline playbooks/fstests.yml \
+ --limit 'baseline' \
+ playbooks/fstests.yml \
--tags run_tests,copy_results \
--skip-tags git_update \
--extra-vars \
@@ -173,7 +177,8 @@ fstests-baseline-skip-kdevops-update: $(KDEVOPS_EXTRA_VARS)
fstests-baseline-run-oscheck-only: $(KDEVOPS_EXTRA_VARS)
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
- -i hosts -l baseline playbooks/fstests.yml \
+ --limit 'baseline' \
+ playbooks/fstests.yml \
--tags run_tests,copy_results \
--skip-tags git_update,reboot,clean_results \
--extra-vars \
@@ -183,14 +188,14 @@ fstests-baseline-run-oscheck-only: $(KDEVOPS_EXTRA_VARS)
fstests-config: $(KDEVOPS_EXTRA_VARS)
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
- -i hosts -l baseline playbooks/fstests.yml \
+ --limit 'baseline' \
+ playbooks/fstests.yml \
--tags vars,generate-fstests-config \
--extra-vars=@./extra_vars.yaml \
$(LIMIT_HOSTS)
fstests-config-debug: $(KDEVOPS_EXTRA_VARS)
- $(Q)ansible-playbook $(ANSIBLE_VERBOSE) --connection=local \
- --inventory localhost, \
+ $(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
playbooks/fstests.yml \
-e 'fstests_debug_localhost=True' \
--tags vars,generate-fstests-config \
@@ -198,7 +203,8 @@ fstests-config-debug: $(KDEVOPS_EXTRA_VARS)
fstests-dev: $(KDEVOPS_EXTRA_VARS)
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
- -i hosts -l dev playbooks/fstests.yml \
+ --limit 'dev' \
+ playbooks/fstests.yml \
--tags vars,run_tests,copy_results \
--extra-vars \
'{ $(FSTESTS_DYNAMIC_RUNTIME_VARS) }' \
@@ -206,7 +212,8 @@ fstests-dev: $(KDEVOPS_EXTRA_VARS)
fstests-baseline-results-tfb-ls: $(KDEVOPS_EXTRA_VARS)
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
- -i hosts -l baseline playbooks/fstests.yml \
+ --limit 'baseline' \
+ playbooks/fstests.yml \
--tags vars,tfb \
--skip-tags copy_final \
--extra-vars \
@@ -215,7 +222,8 @@ fstests-baseline-results-tfb-ls: $(KDEVOPS_EXTRA_VARS)
fstests-baseline-results-tfb-trim: $(KDEVOPS_EXTRA_VARS)
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
- -i hosts -l baseline playbooks/fstests.yml \
+ --limit 'baseline' \
+ playbooks/fstests.yml \
--tags vars,tfb \
--skip-tags copy_final \
--extra-vars \
@@ -224,7 +232,8 @@ fstests-baseline-results-tfb-trim: $(KDEVOPS_EXTRA_VARS)
fstests-baseline-results: $(KDEVOPS_EXTRA_VARS)
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
- -i hosts -l baseline playbooks/fstests.yml \
+ --limit 'baseline' \
+ playbooks/fstests.yml \
--tags copy_results,print_results,tfb \
--extra-vars '{ kdevops_run_fstests: True }' \
--extra-vars=@./extra_vars.yaml \
@@ -234,7 +243,8 @@ fstests-results: fstests-baseline-results
fstests-dev-results: $(KDEVOPS_EXTRA_VARS)
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
- -i hosts -l dev playbooks/fstests.yml \
+ --limit 'dev' \
+ playbooks/fstests.yml \
--tags copy_results,print_results \
--extra-vars '{ kdevops_run_fstests: True }' \
--extra-vars=@./extra_vars.yaml \
diff --git a/workflows/gitr/Makefile b/workflows/gitr/Makefile
index b8a1b3a439911247c0b0289321e64873efb5bc83..09ef466f70b955fd3032f8f836ba1ce4854f8513 100644
--- a/workflows/gitr/Makefile
+++ b/workflows/gitr/Makefile
@@ -90,13 +90,13 @@ endif
gitr:
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
- -i $(KDEVOPS_HOSTFILE) -l baseline,dev \
+ --limit 'baseline:dev' \
--skip-tags run_tests,run_specific_tests,copy_results \
$(KDEVOPS_PLAYBOOKS_DIR)/gitr.yml
gitr-baseline:
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
- -i $(KDEVOPS_HOSTFILE) -l baseline \
+ --limit 'baseline' \
--tags $(GITR_PLAY_TAGS) \
--extra-vars=@./extra_vars.yaml \
$(KDEVOPS_PLAYBOOKS_DIR)/gitr.yml
@@ -109,7 +109,7 @@ gitr-baseline-kernelci:
gitr-dev-baseline:
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
- -i $(KDEVOPS_HOSTFILE) -l dev \
+ --limit 'dev' \
--tags $(GITR_PLAY_TAGS) \
--extra-vars=@./extra_vars.yaml \
$(KDEVOPS_PLAYBOOKS_DIR)/gitr.yml
@@ -122,7 +122,7 @@ gitr-dev-kernelci:
gitr-dev-reset:
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
- -i $(KDEVOPS_HOSTFILE) -l dev \
+ --limit 'dev' \
--tags vars,reset \
--extra-vars=@./extra_vars.yaml \
$(KDEVOPS_PLAYBOOKS_DIR)/gitr.yml
diff --git a/workflows/linux/Makefile b/workflows/linux/Makefile
index 4d208e3e2de3d40e87df1e4d06a46723d05fb4da..199161fa29a503cec9593182d849422e73158597 100644
--- a/workflows/linux/Makefile
+++ b/workflows/linux/Makefile
@@ -75,6 +75,7 @@ linux-help-menu:
echo "linux-mount - Mounts 9p path on targets" ;\
fi
@echo "linux-deploy - Builds, installs, updates GRUB and reboots - useful for rapid development"
+ @echo "linux-build - Builds kernel"
@echo "linux-install - Only builds and installs Linux"
@echo "linux-uninstall - Remove a kernel you can pass arguments for the version such as KVER=6.5.0-rc7-next-20230825"
@echo "linux-clone - Only clones Linux"
@@ -91,51 +92,66 @@ LINUX_HELP_EXTRA :=
PHONY += linux
linux: $(KDEVOPS_NODES)
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
+ --limit 'all:!localhost' \
$(KDEVOPS_PLAYBOOKS_DIR)/bootlinux-local.yml \
--extra-vars="$(BOOTLINUX_ARGS)"
- $(Q)ansible-playbook $(ANSIBLE_VERBOSE) -i \
- $(KDEVOPS_HOSTFILE) $(KDEVOPS_PLAYBOOKS_DIR)/bootlinux.yml \
+ $(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
+ --limit 'all:!localhost' \
+ $(KDEVOPS_PLAYBOOKS_DIR)/bootlinux.yml \
--extra-vars="$(BOOTLINUX_ARGS)" $(LIMIT_HOSTS)
PHONY += linux-mount
linux-mount:
- $(Q)ansible-playbook $(ANSIBLE_VERBOSE) -i \
- $(KDEVOPS_HOSTFILE) $(KDEVOPS_PLAYBOOKS_DIR)/bootlinux.yml \
+ $(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
+ --limit 'all:!localhost' \
+ $(KDEVOPS_PLAYBOOKS_DIR)/bootlinux.yml \
--tags vars,9p_mount \
--extra-vars="$(BOOTLINUX_ARGS)" $(LIMIT_HOSTS)
PHONY += linux-deploy
linux-deploy:
- $(Q)ansible-playbook $(ANSIBLE_VERBOSE) -i \
- $(KDEVOPS_HOSTFILE) $(KDEVOPS_PLAYBOOKS_DIR)/bootlinux.yml \
+ $(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
+ --limit 'all:!localhost' \
+ $(KDEVOPS_PLAYBOOKS_DIR)/bootlinux.yml \
--tags vars,build-linux,install-linux,manual-update-grub,saved,vars,reboot \
--extra-vars="$(BOOTLINUX_ARGS)" $(LIMIT_HOSTS)
+PHONY += linux-build
+linux-build:
+ $(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
+ --limit 'all:!localhost' \
+ $(KDEVOPS_PLAYBOOKS_DIR)/bootlinux.yml \
+ --tags vars,build-linux,saved,vars \
+ --extra-vars="$(BOOTLINUX_ARGS)" $(LIMIT_HOSTS)
+
PHONY += linux-install
linux-install:
- $(Q)ansible-playbook $(ANSIBLE_VERBOSE) -i \
- $(KDEVOPS_HOSTFILE) $(KDEVOPS_PLAYBOOKS_DIR)/bootlinux.yml \
+ $(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
+ --limit 'all:!localhost' \
+ $(KDEVOPS_PLAYBOOKS_DIR)/bootlinux.yml \
--tags vars,build-linux,install-linux \
--extra-vars="$(BOOTLINUX_ARGS)" $(LIMIT_HOSTS)
PHONY += linux-uninstall
linux-uninstall:
- $(Q)ansible-playbook $(ANSIBLE_VERBOSE) -i \
- $(KDEVOPS_HOSTFILE) $(KDEVOPS_PLAYBOOKS_DIR)/bootlinux.yml \
+ $(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
+ --limit 'all:!localhost' \
+ $(KDEVOPS_PLAYBOOKS_DIR)/bootlinux.yml \
--tags uninstall-linux,vars \
--extra-vars '{ "uninstall_kernel_enable": "True", $(LINUX_DYNAMIC_RUNTIME_VARS) }' \
$(LIMIT_HOSTS)
linux-clone-clients: $(KDEVOPS_NODES)
- $(Q)ansible-playbook $(ANSIBLE_VERBOSE) -i \
- $(KDEVOPS_HOSTFILE) $(KDEVOPS_PLAYBOOKS_DIR)/bootlinux.yml \
+ $(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
+ --limit 'all:!localhost' \
+ $(KDEVOPS_PLAYBOOKS_DIR)/bootlinux.yml \
--extra-vars="$(BOOTLINUX_ARGS)" $(LIMIT_HOSTS) \
--tags vars,deps,clone
PHONY += linux-clone-9p
linux-clone-9p: $(KDEVOPS_NODES)
- $(Q)ansible-playbook $(ANSIBLE_VERBOSE) --connection=local \
- --inventory localhost, \
+ $(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
+ --limit 'localhost' \
$(KDEVOPS_PLAYBOOKS_DIR)/bootlinux.yml \
--extra-vars="$(BOOTLINUX_ARGS)" \
--tags vars,deps,clone
@@ -145,27 +161,30 @@ linux-clone: $(KDEVOPS_NODES) $(LINUX_CLONE_DEFAULT_TYPE)
PHONY += linux-grub-setup
linux-grub-setup:
- $(Q)ansible-playbook $(ANSIBLE_VERBOSE) -i \
- $(KDEVOPS_HOSTFILE) $(KDEVOPS_PLAYBOOKS_DIR)/bootlinux.yml \
+ $(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
+ --limit 'all:!localhost' \
+ $(KDEVOPS_PLAYBOOKS_DIR)/bootlinux.yml \
--extra-vars="$(BOOTLINUX_ARGS)" $(LIMIT_HOSTS) --tags manual-update-grub,saved,vars
PHONY += linux-reboot
linux-reboot:
- $(Q)ansible-playbook $(ANSIBLE_VERBOSE) -i \
- $(KDEVOPS_HOSTFILE) $(KDEVOPS_PLAYBOOKS_DIR)/bootlinux.yml \
+ $(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
+ --limit 'all:!localhost' \
+ $(KDEVOPS_PLAYBOOKS_DIR)/bootlinux.yml \
--extra-vars="$(BOOTLINUX_ARGS)" $(LIMIT_HOSTS) --tags vars,reboot
PHONY += uname
uname:
- $(Q)ansible 'all:!localhost' -i hosts -b -m command -a "uname -r" -o \
+ $(Q)ansible 'all:!localhost' -b -m command -a "uname -r" -o \
| awk -F '|' '{gsub(/^ +| +$$/, "", $$2); printf "%-30s %s\n", $$1, $$4}' \
| sed -e 's|(stdout)||'
ifeq (y,$(CONFIG_KDEVOPS_WORKFLOW_ENABLE_CXL))
PHONY += linux-cxl
linux-cxl: $(KDEVOPS_NODES)
- $(Q)ansible-playbook $(ANSIBLE_VERBOSE) -i \
- $(KDEVOPS_HOSTFILE) $(KDEVOPS_PLAYBOOKS_DIR)/bootlinux.yml \
+ $(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
+ --limit 'all:!localhost' \
+ $(KDEVOPS_PLAYBOOKS_DIR)/bootlinux.yml \
--tags 'vars,cxl-build,cxl-install' \
--extra-vars="$(BOOTLINUX_ARGS)" $(LIMIT_HOSTS)
diff --git a/workflows/ltp/Makefile b/workflows/ltp/Makefile
index 081e8364d7f7dbf0cb713285ec869d9f1977f539..ddbdf7399789ffae037dabd4ec8f49e696cff18b 100644
--- a/workflows/ltp/Makefile
+++ b/workflows/ltp/Makefile
@@ -116,13 +116,13 @@ endif
ltp:
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
- -i $(KDEVOPS_HOSTFILE) -l baseline,dev \
+ --limit 'baseline:dev' \
--skip-tags run_tests,copy_results \
$(KDEVOPS_PLAYBOOKS_DIR)/ltp.yml
ltp-baseline:
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
- -i $(KDEVOPS_HOSTFILE) -l baseline \
+ --limit 'baseline' \
--tags vars,run_tests,copy_results \
--extra-vars=@./extra_vars.yaml \
$(KDEVOPS_PLAYBOOKS_DIR)/ltp.yml
@@ -135,7 +135,7 @@ ltp-baseline-kernelci:
ltp-dev-baseline:
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
- -i $(KDEVOPS_HOSTFILE) -l dev \
+ --limit 'dev' \
--tags vars,run_tests,copy_results \
--extra-vars=@./extra_vars.yaml \
$(KDEVOPS_PLAYBOOKS_DIR)/ltp.yml
@@ -148,7 +148,7 @@ ltp-dev-kernelci:
ltp-dev-reset:
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
- -i $(KDEVOPS_HOSTFILE) -l dev \
+ --limit 'dev' \
--tags vars,reset \
--extra-vars=@./extra_vars.yaml \
$(KDEVOPS_PLAYBOOKS_DIR)/ltp.yml
diff --git a/workflows/nfstest/Makefile b/workflows/nfstest/Makefile
index 80c00c12c20520953e0c0a11d2f324512fb51190..3945edf66d83dcc422337c3f6c693ddd04500251 100644
--- a/workflows/nfstest/Makefile
+++ b/workflows/nfstest/Makefile
@@ -73,13 +73,13 @@ endif
nfstest:
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
- -i $(KDEVOPS_HOSTFILE) -l baseline,dev \
+ --limit 'baseline:dev' \
--skip-tags run_tests,copy_results \
$(KDEVOPS_PLAYBOOKS_DIR)/nfstest.yml
nfstest-baseline:
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
- -i $(KDEVOPS_HOSTFILE) -l baseline \
+ --limit 'baseline' \
--tags vars,run_tests,copy_results \
--extra-vars=@./extra_vars.yaml \
$(KDEVOPS_PLAYBOOKS_DIR)/nfstest.yml
@@ -92,7 +92,7 @@ nfstest-baseline-kernelci:
nfstest-dev-baseline:
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
- -i $(KDEVOPS_HOSTFILE) -l dev \
+ --limit 'dev' \
--tags vars,run_tests,copy_results \
--extra-vars=@./extra_vars.yaml \
$(KDEVOPS_PLAYBOOKS_DIR)/nfstest.yml
@@ -105,7 +105,7 @@ nfstest-dev-kernelci:
nfstest-dev-reset:
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
- -i $(KDEVOPS_HOSTFILE) -l dev \
+ --limit 'dev' \
--tags vars,reset \
--extra-vars=@./extra_vars.yaml \
$(KDEVOPS_PLAYBOOKS_DIR)/nfstest.yml
diff --git a/workflows/pynfs/Makefile b/workflows/pynfs/Makefile
index dc4b29c52ccf6455e52a6de8f1f12de81bc484a2..1dfd349c868c3fd58565ac8a8f9eb86aabc1b588 100644
--- a/workflows/pynfs/Makefile
+++ b/workflows/pynfs/Makefile
@@ -45,18 +45,18 @@ endif
# Makefile for pynfs targets
pynfs:
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
- -i $(KDEVOPS_HOSTFILE) -l baseline,dev \
+ --limit 'baseline:dev' \
--skip-tags run_tests,copy_results,clean_local_results \
$(KDEVOPS_PLAYBOOKS_DIR)/pynfs.yml
pynfs-baseline:
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
- -i $(KDEVOPS_HOSTFILE) -l baseline \
+ --limit 'baseline' \
--tags vars,first_run,reset \
--extra-vars=@./extra_vars.yaml \
$(KDEVOPS_PLAYBOOKS_DIR)/pynfs.yml
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
- -i $(KDEVOPS_HOSTFILE) -l baseline \
+ --limit 'baseline' \
--tags vars,run_tests,copy_results \
--extra-vars=@./extra_vars.yaml \
$(KDEVOPS_PLAYBOOKS_DIR)/pynfs.yml
@@ -75,12 +75,12 @@ pynfs-baseline-kernelci:
# Below are the corresponding dev targets
pynfs-dev-baseline:
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
- -i $(KDEVOPS_HOSTFILE) -l dev \
+ --limit 'dev' \
--tags vars,first_run,reset \
--extra-vars=@./extra_vars.yaml \
$(KDEVOPS_PLAYBOOKS_DIR)/pynfs.yml
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
- -i $(KDEVOPS_HOSTFILE) -l dev \
+ --limit 'dev' \
--tags vars,run_tests,copy_results \
--extra-vars=@./extra_vars.yaml \
$(KDEVOPS_PLAYBOOKS_DIR)/pynfs.yml
@@ -93,7 +93,7 @@ pynfs-dev-kernelci:
pynfs-dev-reset:
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
- -i $(KDEVOPS_HOSTFILE) -l dev \
+ --limit 'dev' \
--tags vars,reset \
--extra-vars=@./extra_vars.yaml \
$(KDEVOPS_PLAYBOOKS_DIR)/pynfs.yml
diff --git a/workflows/selftests/Makefile b/workflows/selftests/Makefile
index 075da61b0c26829ab4732d640da736cc958ee394..d3b7044c4ec7bf2468e36b5a1242ff1831356041 100644
--- a/workflows/selftests/Makefile
+++ b/workflows/selftests/Makefile
@@ -33,24 +33,27 @@ include $(TOPDIR)/workflows/selftests/tests/Makefile.xarray
selftests:
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
- -i hosts playbooks/selftests.yml \
+ playbooks/selftests.yml \
--skip-tags run_tests,copy_results,check_results \
$(LIMIT_HOSTS)
selftests-baseline:
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
- -i hosts -l baseline playbooks/selftests.yml \
+ --limit 'baseline' \
+ playbooks/selftests.yml \
--extra-vars '{ $(SELFTESTS_DYNAMIC_RUNTIME_VARS) }' \
--tags vars,run_tests,copy_results,check_results $(LIMIT_HOSTS)
selftests-results:
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
- -i hosts -l baseline playbooks/selftests.yml \
+ --limit 'baseline' \
+ playbooks/selftests.yml \
--tags vars,copy_results,check_results $(LIMIT_HOSTS)
selftests-check-results:
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
- -i hosts -l baseline playbooks/selftests.yml \
+ --limit 'baseline' \
+ playbooks/selftests.yml \
--tags vars,check_results $(LIMIT_HOSTS)
selftests-help-main:
diff --git a/workflows/sysbench/Makefile b/workflows/sysbench/Makefile
index 21cb297e722c6190ecd2b8ced96d7fa675a38214..daf7bc75da2b7b164ca8a2bd891a41d097b8669b 100644
--- a/workflows/sysbench/Makefile
+++ b/workflows/sysbench/Makefile
@@ -29,36 +29,36 @@ TAGS_SYSBENCH_RESULTS += results
# Target to set up sysbench (MySQL or PostgreSQL)
sysbench:
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
- -i hosts playbooks/sysbench.yml \
+ playbooks/sysbench.yml \
--skip-tags $(subst $(space),$(comma),$(TAGS_SYSBENCH_RUN))
# Target to run sysbench tests (including telemetry)
sysbench-test:
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
- -i hosts playbooks/sysbench.yml \
+ playbooks/sysbench.yml \
--tags $(subst $(space),$(comma),$(TAGS_SYSBENCH_TEST))
# Optional target to collect telemetry
sysbench-telemetry:
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
- -i hosts playbooks/sysbench.yml \
+ playbooks/sysbench.yml \
--tags $(subst $(space),$(comma),$(TAGS_SYSBENCH_TELEMETRY))
# Optional target to collect all results
sysbench-results:
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
- -i hosts playbooks/sysbench.yml \
+ playbooks/sysbench.yml \
--tags $(subst $(space),$(comma),$(TAGS_SYSBENCH_RESULTS))
sysbench-clean:
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
- -i hosts playbooks/sysbench.yml \
+ playbooks/sysbench.yml \
--tags vars,clean
# Optional in case you want to improve graphing
sysbench-plot:
$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
- -i hosts playbooks/sysbench.yml \
+ playbooks/sysbench.yml \
--tags vars,plot
# Help target to show available options
--
2.49.0
^ permalink raw reply related [flat|nested] 20+ messages in thread
* Re: [PATCH 6/8] ansible_cfg: add inventory support
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
0 siblings, 1 reply; 20+ messages in thread
From: Chuck Lever @ 2025-05-01 19:41 UTC (permalink / raw)
To: Daniel Gomez, Luis Chamberlain; +Cc: kdevops, Daniel Gomez
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.
> + 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.
> +
> if DISTRO_OPENSUSE
>
> config ANSIBLE_CFG_RECONNECTION_RETRIES
> diff --git a/kconfigs/Kconfig.ansible_provisioning b/kconfigs/Kconfig.ansible_provisioning
> index 63f04306e7b26f228defa9e50630f5ed07eaac37..4416d06754df3a9645fef15173e83e2279cfce1a 100644
> --- a/kconfigs/Kconfig.ansible_provisioning
> +++ b/kconfigs/Kconfig.ansible_provisioning
> @@ -98,12 +98,6 @@ config KDEVOPS_DEVCONFIG_SYSTEMD_WATCHDOG_TIMEOUT_KEXEC
>
> endif # KDEVOPS_DEVCONFIG_ENABLE_SYSTEMD_WATCHDOG
>
> -config KDEVOPS_ANSIBLE_INVENTORY_FILE
> - string "The ansible inventory file to use"
> - default $(shell, scripts/append-makefile-vars.sh $(KDEVOPS_HOSTFILE))
> - help
> - The file to use for the ansible inventory.
> -
> config HAVE_DISTRO_PREFERS_ANSIBLE_PYTHON2
> bool
> default n
> diff --git a/playbooks/roles/ansible_cfg/templates/ansible.cfg.j2 b/playbooks/roles/ansible_cfg/templates/ansible.cfg.j2
> index 2bc916321f424ab93447af40eccef30911d27bb6..fddbab6d3a4dc03524a819b5b695336445ecb732 100644
> --- a/playbooks/roles/ansible_cfg/templates/ansible.cfg.j2
> +++ b/playbooks/roles/ansible_cfg/templates/ansible.cfg.j2
> @@ -10,6 +10,7 @@ show_per_host_start = {{ ansible_cfg_callback_plugin_show_per_host_start }}
> show_task_path_on_failure = {{ ansible_cfg_callback_plugin_show_task_path_on_failure }}
> interpreter_python = {{ ansible_cfg_interpreter_python_string }}
> forks = {{ ansible_cfg_forks }}
> +inventory = {{ ansible_cfg_inventory }}
> {% if ansible_facts['distribution'] == 'openSUSE' %}
> [connection]
> retries = {{ ansible_cfg_reconnection_retries }}
>
--
Chuck Lever
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH 6/8] ansible_cfg: add inventory support
2025-05-01 19:41 ` Chuck Lever
@ 2025-05-01 20:22 ` Daniel Gomez
2025-05-01 20:40 ` Chuck Lever
0 siblings, 1 reply; 20+ messages in thread
From: Daniel Gomez @ 2025-05-01 20:22 UTC (permalink / raw)
To: Chuck Lever; +Cc: Luis Chamberlain, kdevops, Daniel Gomez
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
>
>
> > + 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.
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH 6/8] ansible_cfg: add inventory support
2025-05-01 20:22 ` Daniel Gomez
@ 2025-05-01 20:40 ` Chuck Lever
2025-05-01 21:50 ` Daniel Gomez
0 siblings, 1 reply; 20+ messages in thread
From: Chuck Lever @ 2025-05-01 20:40 UTC (permalink / raw)
To: Daniel Gomez; +Cc: Luis Chamberlain, kdevops, Daniel Gomez
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
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH 6/8] ansible_cfg: add inventory support
2025-05-01 20:40 ` Chuck Lever
@ 2025-05-01 21:50 ` Daniel Gomez
0 siblings, 0 replies; 20+ messages in thread
From: Daniel Gomez @ 2025-05-01 21:50 UTC (permalink / raw)
To: Chuck Lever; +Cc: Luis Chamberlain, kdevops, Daniel Gomez
On Thu, May 01, 2025 at 04:40:49PM +0100, Chuck Lever wrote:
> 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.
I'll cover this in v2.
>
> (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.)
I'll create content for ansible_cfg in docs/ including the inventory.
>
>
> >>> + 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.
I've used this sandbox concept in other projects and I found it useful for
switching between them. It requires to move all current configuration files such
as .config, ssh, inventory etc into it's own sandbox. Not sure yet if libvirt
can play nice here with the guests.
BTW, it'd be very useful for me if you can give this a quick spin when you
have some time to ensure I'm not breaking any of the current workflows with
the inventory refactor. There's rush. Current CI covers bringup, fstests and
bootlinux.
>
> --
> Chuck Lever
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH 0/8] Define Ansible inventory in the Ansible Configuration file
2025-05-01 18:35 [PATCH 0/8] Define Ansible inventory in the Ansible Configuration file Daniel Gomez
` (7 preceding siblings ...)
2025-05-01 18:35 ` [PATCH 8/8] Makefile: use inventory from ansible.cfg Daniel Gomez
@ 2025-05-02 16:34 ` Luis Chamberlain
2025-05-02 19:27 ` Daniel Gomez
8 siblings, 1 reply; 20+ messages in thread
From: Luis Chamberlain @ 2025-05-02 16:34 UTC (permalink / raw)
To: Daniel Gomez; +Cc: Chuck Lever, kdevops, Daniel Gomez
On Thu, May 01, 2025 at 08:35:46PM +0200, Daniel Gomez wrote:
> This promotes the Ansible inventory file (typically 'hosts' in kdevops)
> to the Ansible Configuration file (ansible.cfg). By doing this, we allow
> to control the hosts globally rather than in all the ansible-playbook
> commands, as well as clean up the ansible-playbook command.
>
> So, we don't need to define anymore the inventory file in the command.
I was trying to find a motivation, just wanted to double check if the
above was it, or if you had something a bit more forward looking in mind
for it.
Luis
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH 0/8] Define Ansible inventory in the Ansible Configuration file
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
0 siblings, 1 reply; 20+ messages in thread
From: Daniel Gomez @ 2025-05-02 19:27 UTC (permalink / raw)
To: Luis Chamberlain; +Cc: Chuck Lever, kdevops, Daniel Gomez
On Fri, May 02, 2025 at 09:34:49AM +0100, Luis Chamberlain wrote:
> On Thu, May 01, 2025 at 08:35:46PM +0200, Daniel Gomez wrote:
> > This promotes the Ansible inventory file (typically 'hosts' in kdevops)
> > to the Ansible Configuration file (ansible.cfg). By doing this, we allow
> > to control the hosts globally rather than in all the ansible-playbook
> > commands, as well as clean up the ansible-playbook command.
> >
> > So, we don't need to define anymore the inventory file in the command.
>
> I was trying to find a motivation, just wanted to double check if the
> above was it, or if you had something a bit more forward looking in mind
> for it.
Motivation came after fork patches from Chuck. However, the sandbox idea shared
some time ago [1] is really why this cleanup makes sense to me. For that, what
is needed is just the ability to replace the KDEVOPS_HOSTS path and not assume
$topdir_path/$hosts in gen_hosts playbook. The rest is just cleanup and letting
Ansible handle it instead of being explicit every time. I'm also considering
including localhost in the inventory file part of the cleanup as it allows to
remove the --connection and --inventory args.
BTW, I think this last thing also helps to run kdevops in the localhost/
baremetal. I shared this topic in the other thread (v2). But is this currently
possible? I tried running fstests SKIP_BRINGUP but did not work for me.
[1]
https://lore.kernel.org/all/20240827-ansible-cleanups-v1-0-2828a816de5e@samsung.com/
>
> Luis
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH 0/8] Define Ansible inventory in the Ansible Configuration file
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:17 ` Daniel Gomez
0 siblings, 2 replies; 20+ messages in thread
From: Luis Chamberlain @ 2025-05-02 22:43 UTC (permalink / raw)
To: Daniel Gomez; +Cc: Chuck Lever, kdevops, Daniel Gomez
On Fri, May 02, 2025 at 09:27:13PM +0200, Daniel Gomez wrote:
> On Fri, May 02, 2025 at 09:34:49AM +0100, Luis Chamberlain wrote:
> > On Thu, May 01, 2025 at 08:35:46PM +0200, Daniel Gomez wrote:
> > > This promotes the Ansible inventory file (typically 'hosts' in kdevops)
> > > to the Ansible Configuration file (ansible.cfg). By doing this, we allow
> > > to control the hosts globally rather than in all the ansible-playbook
> > > commands, as well as clean up the ansible-playbook command.
> > >
> > > So, we don't need to define anymore the inventory file in the command.
> >
> > I was trying to find a motivation, just wanted to double check if the
> > above was it, or if you had something a bit more forward looking in mind
> > for it.
>
> Motivation came after fork patches from Chuck. However, the sandbox idea shared
> some time ago [1] is really why this cleanup makes sense to me.
I figured it must be more than what was stated above, its useful if you
mention this in the future, because it just seemed like a lot of work
just for a cleanup.
But I don't see the explicit requirement of !localhost thing as cleanup,
I see that as an eyesore frankly. So I was hoping for more motivation
for this.
Whatever brings more determinism with less code -- the better, so I do
appreciate the cleanup side of things.
> For that, what
> is needed is just the ability to replace the KDEVOPS_HOSTS path and not assume
> $topdir_path/$hosts in gen_hosts playbook.
I think it breaks the existing crash library too.
> The rest is just cleanup and letting
> Ansible handle it instead of being explicit every time. I'm also considering
> including localhost in the inventory file part of the cleanup as it allows to
> remove the --connection and --inventory args.
I see.
> BTW, I think this last thing also helps to run kdevops in the localhost/
> baremetal. I shared this topic in the other thread (v2). But is this currently
> possible? I tried running fstests SKIP_BRINGUP but did not work for me.
>
> [1]
> https://lore.kernel.org/all/20240827-ansible-cleanups-v1-0-2828a816de5e@samsung.com/
Right now you're on your own if you use SKIP_BRINGUP. I actually have a
need to go work on that now so will give that a spin next week or this
week. So if this patch set helps, I can embrace it as a base for sure.
Luis
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH 0/8] Define Ansible inventory in the Ansible Configuration file
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
1 sibling, 1 reply; 20+ messages in thread
From: Luis Chamberlain @ 2025-05-02 22:45 UTC (permalink / raw)
To: Daniel Gomez; +Cc: Chuck Lever, kdevops, Daniel Gomez
On Fri, May 02, 2025 at 03:43:20PM -0700, Luis Chamberlain wrote:
> I think it breaks the existing crash library too.
Oh and existing running systems would break too no? Ie if you had
an established 'make bringup', I think git fetch and git reset to the
latest would make it no longer work?
Luis
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH 0/8] Define Ansible inventory in the Ansible Configuration file
2025-05-02 22:43 ` Luis Chamberlain
2025-05-02 22:45 ` Luis Chamberlain
@ 2025-05-03 18:17 ` Daniel Gomez
2025-05-03 18:58 ` Luis Chamberlain
1 sibling, 1 reply; 20+ messages in thread
From: Daniel Gomez @ 2025-05-03 18:17 UTC (permalink / raw)
To: Luis Chamberlain; +Cc: Chuck Lever, kdevops, Daniel Gomez
On Fri, May 02, 2025 at 03:43:19PM +0100, Luis Chamberlain wrote:
> On Fri, May 02, 2025 at 09:27:13PM +0200, Daniel Gomez wrote:
> > On Fri, May 02, 2025 at 09:34:49AM +0100, Luis Chamberlain wrote:
> > > On Thu, May 01, 2025 at 08:35:46PM +0200, Daniel Gomez wrote:
> > > > This promotes the Ansible inventory file (typically 'hosts' in kdevops)
> > > > to the Ansible Configuration file (ansible.cfg). By doing this, we allow
> > > > to control the hosts globally rather than in all the ansible-playbook
> > > > commands, as well as clean up the ansible-playbook command.
> > > >
> > > > So, we don't need to define anymore the inventory file in the command.
> > >
> > > I was trying to find a motivation, just wanted to double check if the
> > > above was it, or if you had something a bit more forward looking in mind
> > > for it.
> >
> > Motivation came after fork patches from Chuck. However, the sandbox idea shared
> > some time ago [1] is really why this cleanup makes sense to me.
>
> I figured it must be more than what was stated above, its useful if you
> mention this in the future, because it just seemed like a lot of work
> just for a cleanup.
I'll update the cover letter with this.
>
> But I don't see the explicit requirement of !localhost thing as cleanup,
> I see that as an eyesore frankly. So I was hoping for more motivation
> for this.
'!localhost' is Ansible syntax [1] for describing current kdevops workflow.
We just avoid doing it by not including localhost in the inventory file. But
I do think replacing 'all:!localhost' with 'baseline:dev' makes more sense for
kdevops context. Then, we would also enable workflows to also run in baremetal.
For that, we just need to map the SKIP_BRINGUP config to the inventory template
to add localhost to the baseline group of targets. So, I'm thinking of adding
that for the next revision. But let me know your thoughts regarding the syntax
and idea.
[1]
https://docs.ansible.com/ansible/latest/inventory_guide/intro_patterns.html#common-patterns
>
> Whatever brings more determinism with less code -- the better, so I do
> appreciate the cleanup side of things.
Thanks.
>
> > For that, what
> > is needed is just the ability to replace the KDEVOPS_HOSTS path and not assume
> > $topdir_path/$hosts in gen_hosts playbook.
>
>
> I think it breaks the existing crash library too.
I've updated the crash.py to use the new expected syntax. I see
crash_watchdog.py is missing a change when calling ansible-inventory.
Since I had yet to add the crash watchdog to the mm CI, I'll use this series to
validate it as well.
>
> > The rest is just cleanup and letting
> > Ansible handle it instead of being explicit every time. I'm also considering
> > including localhost in the inventory file part of the cleanup as it allows to
> > remove the --connection and --inventory args.
>
> I see.
>
> > BTW, I think this last thing also helps to run kdevops in the localhost/
> > baremetal. I shared this topic in the other thread (v2). But is this currently
> > possible? I tried running fstests SKIP_BRINGUP but did not work for me.
> >
> > [1]
> > https://lore.kernel.org/all/20240827-ansible-cleanups-v1-0-2828a816de5e@samsung.com/
>
> Right now you're on your own if you use SKIP_BRINGUP. I actually have a
> need to go work on that now so will give that a spin next week or this
> week. So if this patch set helps, I can embrace it as a base for sure.
Absolutely. I'll send a v3 with this support included, as described above.
Besides to the suggested changes to make this work, I think the journal-*
targets (devconfig.yml) may also need changes.
>
> Luis
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH 0/8] Define Ansible inventory in the Ansible Configuration file
2025-05-02 22:45 ` Luis Chamberlain
@ 2025-05-03 18:52 ` Daniel Gomez
0 siblings, 0 replies; 20+ messages in thread
From: Daniel Gomez @ 2025-05-03 18:52 UTC (permalink / raw)
To: Luis Chamberlain; +Cc: Chuck Lever, kdevops, Daniel Gomez
On Fri, May 02, 2025 at 03:45:14PM +0100, Luis Chamberlain wrote:
> On Fri, May 02, 2025 at 03:43:20PM -0700, Luis Chamberlain wrote:
> > I think it breaks the existing crash library too.
>
> Oh and existing running systems would break too no? Ie if you had
> an established 'make bringup', I think git fetch and git reset to the
> latest would make it no longer work?
In that case, running 'make' would suffice to generate the ansible.cfg, which
will configure the inventory file. Once that file includes the inventory field,
all ansible-* commands will start using the expected hosts file.
But I just saw the KDEVOPS_HOSTFILE is exposed as variable that can be
overwritten. Although it doesn't configure the SET_BY_CLI, I think a
user can do 'KDEVOPS_HOSTFILE=myhosts make' to set the current upstream
KDEVOPS_ANSIBLE_INVENTORY_FILE. I'm not sure why SET_BY_CLI is missing but I can
readd KDEVOPS_HOSTFILE with SET_BY_CLI to address this case.
Please, let me know if you can think of any other case where this series may
break a specific workflow. And thanks for the feedback!
>
> Luis
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH 0/8] Define Ansible inventory in the Ansible Configuration file
2025-05-03 18:17 ` Daniel Gomez
@ 2025-05-03 18:58 ` Luis Chamberlain
0 siblings, 0 replies; 20+ messages in thread
From: Luis Chamberlain @ 2025-05-03 18:58 UTC (permalink / raw)
To: Daniel Gomez; +Cc: Chuck Lever, kdevops, Daniel Gomez
On Sat, May 03, 2025 at 08:17:33PM +0200, Daniel Gomez wrote:
> I do think replacing 'all:!localhost' with 'baseline:dev' makes more sense for
> kdevops context.
Yes.
> Then, we would also enable workflows to also run in baremetal.
> For that, we just need to map the SKIP_BRINGUP config to the inventory template
> to add localhost to the baseline group of targets.
Indeed! Also, since I was thinking about bare metal the other day too,
to for example we want to also handle reboots. So we also want to enable say
both host a and b are the baremetal hosts but host c is the command and control.
We want to also enable to run kdevops from host c so it can control both
a and b for the sysbench a/b testing. But this is future work, but
figured I'd mention it in passing now.
> So, I'm thinking of adding
> that for the next revision. But let me know your thoughts regarding the syntax
> and idea.
Yeah makes sense.
> Since I had yet to add the crash watchdog to the mm CI, I'll use this series to
> validate it as well.
I added it to kdevops-ci/mm and it worked on my manual testing pushing,
I added it also to your branch mm-tests-cleanup but I haven't seen a
full new test take effect yet.
> Absolutely. I'll send a v3 with this support included, as described above.
> Besides to the suggested changes to make this work, I think the journal-*
> targets (devconfig.yml) may also need changes.
BTW the regular journal-ln forced runs are no longer required given I
found a simple way to map the host to an IP address for the crash
library, which is also leveraged by the fstests_watchdog.py. The
fstests_watchdog.py now also relies on the console log files and so
our fstests_watchdog.py is as efficient as could be with tons of
fallbacks in case it can't find it.
For terraform we need a nicer way to get kenrel logs than ssh, but it can use
ssh for now. I did a cursory review of terraform for console logs but
couldn't find anything generic enough.
Luis
^ permalink raw reply [flat|nested] 20+ messages in thread
end of thread, other threads:[~2025-05-03 18:58 UTC | newest]
Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox