From patchwork Thu Feb 6 10:44:18 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Daniel Gomez X-Patchwork-Id: 13962796 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8B63222688E for ; Thu, 6 Feb 2025 10:44:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738838683; cv=none; b=g3Qhk25c3QKK9xccR2A68/F5JBLI4DHbOA6Ng9DSGyxi5TLd6zAEHfjDIEAzCzLEwA1iJRD57uUTevAi/pJTOn09JZnutZRfy9HKH1RZU82b/qK5QILeCcMM1c0UrnbPVopB66kUL4V1khOcMsOyUOeFOV0ZaeNT4CY3xmXlF7o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738838683; c=relaxed/simple; bh=n2RS35WJUAHmd2V+n0GwyImB7jMdeFhUeoopbPcwVSE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=X18ApVPtTnE3XnuPS5JZkurQO3mbtlVoFu0jKq/ed/ewzVnHC3JCJ04Oc7BL7hOibNal2gqRmi5mpn9GDLXT6dbdK7KzdvD40DZSmSDA2oOCj0DTf9imFpRbv4d+8Zke/7e9kBr9NqppgZMswgI8Y9r2eSKmNpxnwHMvzHak7jE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=drVICA8d; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="drVICA8d" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9E810C4CEE2; Thu, 6 Feb 2025 10:44:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1738838683; bh=n2RS35WJUAHmd2V+n0GwyImB7jMdeFhUeoopbPcwVSE=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=drVICA8dRp4TO8gblqgWrGaGmamJc/8AZOdXNPs4aNIgN0bstwrqgxmWj40kYHpXV jNk6gvaC4F9P1Wc9f8uoq+MvTX0AXfdJhEBrxvaM5TlIZpMrQCqfjlZ8Oiy2Gpyq8x BKx9CtzEANwopjoUIY1E78LODpW9rjMW3ttJhT+KGyL755tS6L4BAF2vP+Lz18Zydg A0uPK/1ig9UYCYl2OCMrAHbuE7h0A3zzHeaqya6a/ftPGrEH6XNQdYBMkKV3ZRxx6n d0EuLy63s5Vj/PPkcTUWHUhqaPc8Aqf0x9UPjnLOON+qgnRJxBDcO5wFwvtJeNlpB2 pAvJpyIm4hfQQ== From: da.gomez@kernel.org Date: Thu, 06 Feb 2025 10:44:18 +0000 Subject: [PATCH v3 1/4] ansible.cfg: autogenerate using kconfig Precedence: bulk X-Mailing-List: kdevops@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250206-ansible_cfg3-v3-1-4588c8c07e22@samsung.com> References: <20250206-ansible_cfg3-v3-0-4588c8c07e22@samsung.com> In-Reply-To: <20250206-ansible_cfg3-v3-0-4588c8c07e22@samsung.com> To: Luis Chamberlain , Chuck Lever Cc: kdevops@lists.linux.dev, Daniel Gomez X-Mailer: b4 0.14.2 From: Daniel Gomez Add a new ansible.cfg Makefile target, Ansible Playbook and Role to be able to configure the Ansible Configuration file (ansible.cfg) using Kconfig. This generate the ansible.cfg based on the same current settings. Add the new Ansible files (playbooks, cfg, Kconfig...) to the Ansible Wrapper maintainer entry. Move retries to [connection] ini section as per documentation [1]. [1] https://docs.ansible.com/ansible/latest/collections/ansible/builtin/ ssh_connection.html#parameter-reconnection_retries From commit 1961b177a9464423a24cd110f94682def7927331 ("ansible.cfg: bump retries to 2000"), this setting was required for OpenSUSE Tumbleweed. So, apply it only for this distro. Acked-by: Luis Chamberlain Signed-off-by: Daniel Gomez --- .gitignore | 2 + MAINTAINERS | 4 + Makefile | 17 +++- ansible.cfg | 5 - kconfigs/Kconfig.ansible_cfg | 103 +++++++++++++++++++++ kconfigs/Kconfig.kdevops | 4 + playbooks/ansible_cfg.yml | 5 + playbooks/roles/ansible_cfg/defaults/main.yml | 10 ++ playbooks/roles/ansible_cfg/tasks/main.yml | 18 ++++ .../roles/ansible_cfg/templates/ansible.cfg.j2 | 14 +++ 10 files changed, 173 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index c34739832c6501104c9c8bce9c31e87dfd9bcfb0..0ec5d2de89a943c903c3975bf607b72a6604fbb0 100644 --- a/.gitignore +++ b/.gitignore @@ -23,6 +23,8 @@ extra_vars.json .config .config.old +ansible.cfg + scripts/kconfig/.mconf-cfg scripts/workflows/fstests/lib/__pycache__/ scripts/workflows/blktests/lib/__pycache__/ diff --git a/MAINTAINERS b/MAINTAINERS index 045d8c96208ef8f3f1c5d74d023a5117529511cf..6df6709fb59d14ba486050d2ce961923b292ec73 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -72,6 +72,10 @@ M: Daniel Gomez L: kdevops@lists.linux.dev S: Maintained T: git https://github.com/linux-kdevops/kdevops.git +F: ansible.cfg +F: kconfigs/Kconfig.ansible_cfg +F: playbooks/ansible_cfg.yml +F: playbooks/roles/ansible_cfg F: scripts/ansible_av.py F: scripts/ansible.Makefile diff --git a/Makefile b/Makefile index 14e647dcd45190ff51dd42627f58826998f07781..fa8761bcb6bc2c612ef7bff4f904c94ca258d523 100644 --- a/Makefile +++ b/Makefile @@ -190,9 +190,17 @@ include scripts/gen-nodes.Makefile make -f scripts/build.Makefile help ;\ false) + +PHONY += ansible.cfg +ansible.cfg: + @$(Q)ansible-playbook $(ANSIBLE_VERBOSE) --connection=local \ + --inventory localhost, \ + $(KDEVOPS_PLAYBOOKS_DIR)/ansible_cfg.yml \ + --extra-vars=@./.extra_vars_auto.yaml + PHONY += $(EXTRA_VAR_INPUTS) $(EXTRA_VAR_INPUTS_LAST) -$(KDEVOPS_EXTRA_VARS): .config $(EXTRA_VAR_INPUTS) $(EXTRA_VAR_INPUTS_LAST) +$(KDEVOPS_EXTRA_VARS): .config ansible.cfg $(EXTRA_VAR_INPUTS) $(EXTRA_VAR_INPUTS_LAST) playbooks/secret.yml: @if [[ "$(CONFIG_KDEVOPS_REG_TWOLINE_REGCODE)" == "" ]]; then \ @@ -204,7 +212,7 @@ playbooks/secret.yml: @echo "$(CONFIG_KDEVOPS_REG_TWOLINE_REGCODE_VAR): $(CONFIG_KDEVOPS_REG_TWOLINE_REGCODE)" >> $@ ifeq (y,$(CONFIG_KDEVOPS_ENABLE_DISTRO_EXTRA_ADDONS)) -$(KDEVOPS_EXTRA_ADDON_DEST): .config $(KDEVOPS_EXTRA_ADDON_SOURCE) +$(KDEVOPS_EXTRA_ADDON_DEST): .config ansible.cfg $(KDEVOPS_EXTRA_ADDON_SOURCE) $(Q)cp $(KDEVOPS_EXTRA_ADDON_SOURCE) $(KDEVOPS_EXTRA_ADDON_DEST) endif @@ -215,7 +223,7 @@ include scripts/bringup.Makefile endif DEFAULT_DEPS += $(KDEVOPS_HOSTS) -$(KDEVOPS_HOSTS): .config $(KDEVOPS_HOSTS_TEMPLATE) +$(KDEVOPS_HOSTS): .config ansible.cfg $(KDEVOPS_HOSTS_TEMPLATE) $(Q)ansible-playbook $(ANSIBLE_VERBOSE) --connection=local \ --inventory localhost, \ $(KDEVOPS_PLAYBOOKS_DIR)/gen_hosts.yml \ @@ -223,7 +231,7 @@ $(KDEVOPS_HOSTS): .config $(KDEVOPS_HOSTS_TEMPLATE) --extra-vars=@./extra_vars.yaml DEFAULT_DEPS += $(KDEVOPS_NODES) -$(KDEVOPS_NODES) $(KDEVOPS_VAGRANT): .config $(KDEVOPS_NODES_TEMPLATE) +$(KDEVOPS_NODES) $(KDEVOPS_VAGRANT): .config ansible.cfg $(KDEVOPS_NODES_TEMPLATE) $(Q)ansible-playbook $(ANSIBLE_VERBOSE) --connection=local \ --inventory localhost, \ $(KDEVOPS_PLAYBOOKS_DIR)/gen_nodes.yml \ @@ -253,6 +261,7 @@ mrproper: $(Q)rm -f $(KDEVOPS_NODES) $(Q)rm -f $(KDEVOPS_HOSTFILE) $(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) $(Q)rm -rf include $(Q)rm -rf guestfs diff --git a/ansible.cfg b/ansible.cfg deleted file mode 100644 index 08350e0cf0f33e650801f4d8a2b450c77ef22a97..0000000000000000000000000000000000000000 --- a/ansible.cfg +++ /dev/null @@ -1,5 +0,0 @@ -[defaults] -display_skipped_hosts = no -retries = 2000 -deprecation_warnings=False -stdout_callback=debug diff --git a/kconfigs/Kconfig.ansible_cfg b/kconfigs/Kconfig.ansible_cfg new file mode 100644 index 0000000000000000000000000000000000000000..0aa95bfaa6dfd6947f61b1b9da2cf55c16cd95ce --- /dev/null +++ b/kconfigs/Kconfig.ansible_cfg @@ -0,0 +1,103 @@ +menu "Ansible Callback Plugin Configuration" +choice + prompt "Ansible Callback Plugin" + default ANSIBLE_CFG_CALLBACK_PLUGIN_DEBUG + +config ANSIBLE_CFG_CALLBACK_PLUGIN_DEBUG + bool "Ansible Debug Callback Plugin" + help + Debug: https://docs.ansible.com/ansible/latest/collections/ansible/builtin/debug_module.html + +config ANSIBLE_CFG_CALLBACK_PLUGIN_DENSE + bool "Ansible Dense Callback Plugin" + help + Dense: https://docs.ansible.com/ansible/latest/collections/community/general/dense_callback.html + +endchoice + +config ANSIBLE_CFG_CALLBACK_PLUGIN_STRING + string + output yaml + default "debug" if ANSIBLE_CFG_CALLBACK_PLUGIN_DEBUG + default "dense" if ANSIBLE_CFG_CALLBACK_PLUGIN_DENSE + +config ANSIBLE_CFG_CALLBACK_PLUGIN_CHECK_MODE_MARKERS + bool "check_mode_markers" + output yaml + default n + help + Toggle to control displaying markers when running in check mode. + https://docs.ansible.com/ansible/latest/collections/community/general/dense_callback.html#parameter-check_mode_markers + +config ANSIBLE_CFG_CALLBACK_PLUGIN_DISPLAY_FAILED_STDERR + bool "display_failed_stderr" + output yaml + default n + help + Toggle to control whether failed and unreachable tasks are displayed to STDERR (vs. STDOUT). + https://docs.ansible.com/ansible/latest/collections/community/general/dense_callback.html#parameter-display_failed_stderr + +config ANSIBLE_CFG_CALLBACK_PLUGIN_DISPLAY_OK_HOSTS + bool "display_ok_hosts" + output yaml + default y + help + Toggle to control displaying ‘ok’ task/host results in a task. + https://docs.ansible.com/ansible/latest/collections/community/general/dense_callback.html#parameter-display_ok_hosts + +config ANSIBLE_CFG_CALLBACK_PLUGIN_DISPLAY_SKIPPED_HOSTS + bool "display_skipped_hosts" + output yaml + default n + help + Toggle to control displaying skipped task/host results in a task. + https://docs.ansible.com/ansible/latest/collections/community/general/dense_callback.html#parameter-display_skipped_hosts + +config ANSIBLE_CFG_CALLBACK_PLUGIN_SHOW_CUSTOM_STATS + bool "show_custom_stats" + output yaml + default n + help + This adds the custom stats set via the set_stats plugin to the play recap + https://docs.ansible.com/ansible/latest/collections/community/general/dense_callback.html#parameter-show_custom_stats + +config ANSIBLE_CFG_CALLBACK_PLUGIN_SHOW_PER_HOST_START + bool "show_per_host_start" + output yaml + default n + help + This adds output that shows when a task is started to execute for each host + https://docs.ansible.com/ansible/latest/collections/community/general/dense_callback.html#parameter-show_per_host_start + +config ANSIBLE_CFG_CALLBACK_PLUGIN_SHOW_TASK_PATH_ON_FAILURE + bool "show_task_path_on_failure" + output yaml + default n + help + When a task fails, display the path to the file containing the failed task and + the line number. This information is displayed automatically for every task when + running with -vv or greater verbosity. + https://docs.ansible.com/ansible/latest/collections/community/general/dense_callback.html#parameter-show_task_path_on_failure +endmenu + +config ANSIBLE_CFG_DEPRECATION_WARNINGS + bool "deprecation_warnings" + output yaml + default y + help + Toggle to control the showing of deprecation warnings + https://docs.ansible.com/ansible/latest/reference_appendices/config.html#deprecation-warnings + +if DISTRO_OPENSUSE + +config ANSIBLE_CFG_RECONNECTION_RETRIES + string "reconnection_retries" + output yaml + default 2000 + help + Number of attempts to connect. + Ansible retries connections only if it gets an SSH error with a return code of 255. + Any errors with return codes other than 255 indicate an issue with program execution. + https://docs.ansible.com/ansible/latest/collections/ansible/builtin/ssh_connection.html#parameter-reconnection_retries + +endif # DISTRO_OPENSUSE diff --git a/kconfigs/Kconfig.kdevops b/kconfigs/Kconfig.kdevops index c613ff20c193e717413d983af99bb97069988044..35e9758d789255721c522636ada49f84710e042f 100644 --- a/kconfigs/Kconfig.kdevops +++ b/kconfigs/Kconfig.kdevops @@ -195,3 +195,7 @@ endmenu menu "Kernel continous integration configuration" source "kconfigs/Kconfig.kernel-ci" endmenu + +menu "Ansible Configuration" +source "kconfigs/Kconfig.ansible_cfg" +endmenu diff --git a/playbooks/ansible_cfg.yml b/playbooks/ansible_cfg.yml new file mode 100644 index 0000000000000000000000000000000000000000..872f2ee48d29377cd07cf8f75c37d7e32734d914 --- /dev/null +++ b/playbooks/ansible_cfg.yml @@ -0,0 +1,5 @@ +--- +- name: Ansible Configuration Role + hosts: localhost + roles: + - role: ansible_cfg diff --git a/playbooks/roles/ansible_cfg/defaults/main.yml b/playbooks/roles/ansible_cfg/defaults/main.yml new file mode 100644 index 0000000000000000000000000000000000000000..c4787e5b1bb6d792b680f674dd6eac45a9860883 --- /dev/null +++ b/playbooks/roles/ansible_cfg/defaults/main.yml @@ -0,0 +1,10 @@ +--- +ansible_cfg_deprecation_warnings: true +ansible_cfg_callback_plugin_string: debug +ansible_cfg_callback_plugin_check_mode_markers: false +ansible_cfg_callback_plugin_display_failed_stderr: false +ansible_cfg_callback_plugin_display_ok_hosts: true +ansible_cfg_callback_plugin_display_skipped_hosts: true +ansible_cfg_callback_plugin_show_custom_stats: false +ansible_cfg_callback_plugin_show_per_host_start: false +ansible_cfg_callback_plugin_show_task_path_on_failure: false diff --git a/playbooks/roles/ansible_cfg/tasks/main.yml b/playbooks/roles/ansible_cfg/tasks/main.yml new file mode 100644 index 0000000000000000000000000000000000000000..a85d525f21b1a8968e4da73df6882f57b83c32d2 --- /dev/null +++ b/playbooks/roles/ansible_cfg/tasks/main.yml @@ -0,0 +1,18 @@ +--- +- name: Import optional extra_args file + ansible.builtin.include_vars: + file: "{{ item }}" + with_first_found: + - files: + - "../extra_vars.yml" + - "../extra_vars.yaml" + - "../extra_vars.json" + skip: true + failed_when: false + tags: vars + +- name: Generate kdevops ansible.cfg + ansible.builtin.template: + src: "ansible.cfg.j2" + dest: "{{ topdir_path }}/ansible.cfg" + mode: '0755' diff --git a/playbooks/roles/ansible_cfg/templates/ansible.cfg.j2 b/playbooks/roles/ansible_cfg/templates/ansible.cfg.j2 new file mode 100644 index 0000000000000000000000000000000000000000..e13931b5ce97807365a0e0caa0db921a3b2930d7 --- /dev/null +++ b/playbooks/roles/ansible_cfg/templates/ansible.cfg.j2 @@ -0,0 +1,14 @@ +[defaults] +deprecation_warnings = {{ ansible_cfg_deprecation_warnings }} +stdout_callback = {{ ansible_cfg_callback_plugin_string }} +check_mode_markers = {{ ansible_cfg_callback_plugin_check_mode_markers }} +display_failed_stderr = {{ ansible_cfg_callback_plugin_display_failed_stderr }} +display_ok_hosts = {{ ansible_cfg_callback_plugin_display_ok_hosts }} +display_skipped_hosts = {{ ansible_cfg_callback_plugin_display_skipped_hosts }} +show_custom_stats = {{ ansible_cfg_callback_plugin_show_custom_stats }} +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 }} +{% if ansible_facts['distribution'] == 'openSUSE' %} +[connection] +retries = {{ ansible_cfg_reconnection_retries }} +{% endif %} From patchwork Thu Feb 6 10:44:19 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Gomez X-Patchwork-Id: 13962797 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C3FB718B03 for ; Thu, 6 Feb 2025 10:44:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738838684; cv=none; b=osWOfVyqpX6eW4UT8BORfPcya5kB+TiIwGUcaz12q4gRtHmS/dxRcApQ+cpQfDeHl0SOwfDzFF9B5C7YO8bGaSyxLK/ezYwCg5YJf1EUPunltpE0RQ6EQR3/jVYFVZhQfQxI7L9CSs7ud35afDlkcC0yn+UIwzDrUukF3+jAkiM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738838684; c=relaxed/simple; bh=Y7QyYK99Sd0f6akPHwxSFgghIPpNfhUDfR9k7jEA/QI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=qOBM84SNKDpJFMU9ZBIqRgTDebJucbBV+TXIwCaPpA/wu9KeS28MF7ld+sVXQ+RRoyynx6KotPbeBwBLcccZ0N9Wj1E/ihy4RCDH9iZobGIfIg+rWItLORMpzZ/Te/V+DwBqhLblhMTV1NPxURfj97L8gI7PHBS5Ih4oCL+9Wec= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=iAEoBVj3; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="iAEoBVj3" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D3718C4CEE0; Thu, 6 Feb 2025 10:44:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1738838684; bh=Y7QyYK99Sd0f6akPHwxSFgghIPpNfhUDfR9k7jEA/QI=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=iAEoBVj3i2ZtZZI5Whq/Gmobh2HLIujDeSJ4CNbgjXMG+fKRjVTMbk4NG/9oZZaQv c/QKdQQqdPnUwJtUKFY19/eZl06v8ors4mdz1tEGpFx033YZFGoQWvb9PgaV7ru4vc eBarnfDQ4mY+FayvoOu80OJWAxtTy1fQ6WIT43C4YbhzT3sNFnS3faHBwPHx7MqtQw 2wF5KXva1UcQisS6nwlRK6VF1CbwHK+hm+Gu5sfl5xGxl0yzkuxaJ+a4Ok3+3ZgLHa U6bymOxg6B+JR5Ds7PaaZq3ERN8Wqu8FGz52kNSVPNuGhTHWySoOc3CArbOou1qAIW 9o4HajDkcsMFA== From: da.gomez@kernel.org Date: Thu, 06 Feb 2025 10:44:19 +0000 Subject: [PATCH v3 2/4] ansible.cfg: change defaults to minimal Precedence: bulk X-Mailing-List: kdevops@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250206-ansible_cfg3-v3-2-4588c8c07e22@samsung.com> References: <20250206-ansible_cfg3-v3-0-4588c8c07e22@samsung.com> In-Reply-To: <20250206-ansible_cfg3-v3-0-4588c8c07e22@samsung.com> To: Luis Chamberlain , Chuck Lever Cc: kdevops@lists.linux.dev, Daniel Gomez X-Mailer: b4 0.14.2 From: Daniel Gomez Set default Callback plugin to Dense for a minimal stdout. Also, enable show_per_host_start to show when a task is started. And enable show_task_path_on_failure to show failed task when failure. Acked-by: Luis Chamberlain Signed-off-by: Daniel Gomez --- kconfigs/Kconfig.ansible_cfg | 6 +++--- playbooks/roles/ansible_cfg/defaults/main.yml | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/kconfigs/Kconfig.ansible_cfg b/kconfigs/Kconfig.ansible_cfg index 0aa95bfaa6dfd6947f61b1b9da2cf55c16cd95ce..bf09c368d85ece4d1272dbe378e1c283c9f57b89 100644 --- a/kconfigs/Kconfig.ansible_cfg +++ b/kconfigs/Kconfig.ansible_cfg @@ -1,7 +1,7 @@ menu "Ansible Callback Plugin Configuration" choice prompt "Ansible Callback Plugin" - default ANSIBLE_CFG_CALLBACK_PLUGIN_DEBUG + default ANSIBLE_CFG_CALLBACK_PLUGIN_DENSE config ANSIBLE_CFG_CALLBACK_PLUGIN_DEBUG bool "Ansible Debug Callback Plugin" @@ -64,7 +64,7 @@ config ANSIBLE_CFG_CALLBACK_PLUGIN_SHOW_CUSTOM_STATS config ANSIBLE_CFG_CALLBACK_PLUGIN_SHOW_PER_HOST_START bool "show_per_host_start" output yaml - default n + default y help This adds output that shows when a task is started to execute for each host https://docs.ansible.com/ansible/latest/collections/community/general/dense_callback.html#parameter-show_per_host_start @@ -72,7 +72,7 @@ config ANSIBLE_CFG_CALLBACK_PLUGIN_SHOW_PER_HOST_START config ANSIBLE_CFG_CALLBACK_PLUGIN_SHOW_TASK_PATH_ON_FAILURE bool "show_task_path_on_failure" output yaml - default n + default y help When a task fails, display the path to the file containing the failed task and the line number. This information is displayed automatically for every task when diff --git a/playbooks/roles/ansible_cfg/defaults/main.yml b/playbooks/roles/ansible_cfg/defaults/main.yml index c4787e5b1bb6d792b680f674dd6eac45a9860883..c98334aa8f81e397ce4950a84f108a21d78fc784 100644 --- a/playbooks/roles/ansible_cfg/defaults/main.yml +++ b/playbooks/roles/ansible_cfg/defaults/main.yml @@ -1,10 +1,10 @@ --- ansible_cfg_deprecation_warnings: true -ansible_cfg_callback_plugin_string: debug +ansible_cfg_callback_plugin_string: dense ansible_cfg_callback_plugin_check_mode_markers: false ansible_cfg_callback_plugin_display_failed_stderr: false ansible_cfg_callback_plugin_display_ok_hosts: true ansible_cfg_callback_plugin_display_skipped_hosts: true ansible_cfg_callback_plugin_show_custom_stats: false -ansible_cfg_callback_plugin_show_per_host_start: false -ansible_cfg_callback_plugin_show_task_path_on_failure: false +ansible_cfg_callback_plugin_show_per_host_start: true +ansible_cfg_callback_plugin_show_task_path_on_failure: true From patchwork Thu Feb 6 10:44:20 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Gomez X-Patchwork-Id: 13962798 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6D49618B03 for ; Thu, 6 Feb 2025 10:44:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738838686; cv=none; b=h3O+gKrGENtfs7/MJnQpW8vKj/hbe1dG2qrLlpgtUvOV1/ZpkvURPMZIZAKAm9spv9cKwvGnPqheot60lXyfbxSJPWB3vAI8wBdFxL65T+yJkOM6cETdzJQVO3Z61Rn8OsX2jqWgxEOLQF/RB7TFWryd3JcX4ZRX2Q9w9VXcaxE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738838686; c=relaxed/simple; bh=9MJmCpKcjU+eHeoeUKcc3mForLsIL1xrczhn7C+vKwQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=iyb3Rni0MyYGLBw/WniiHlGzH0rVAa/efyqJT1Yop2FGMF8HoQYkmQGMfYGKZwFL5W1M/LdFLdP57biwr3GOymzYss1/qHskL3VZRoAiybKs/K+Quvev7odpuv7rhP1sTNNzKcpdKkETl5ZsI2K05vdS/Y4k+vD6yElza4IgmRs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=qQ98MFvE; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="qQ98MFvE" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 16057C4CEE4; Thu, 6 Feb 2025 10:44:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1738838685; bh=9MJmCpKcjU+eHeoeUKcc3mForLsIL1xrczhn7C+vKwQ=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=qQ98MFvEytsZgFrK+0Q3zw7gJcYmpRvhBe6KIBkV6v9y/hnFUFZNPxS4zI/43t8Mg 8axPrLewZphr+ymcqAxBD4KLcSix9wb0so25QvQanLuQXd4C9v2hRnt6PplKvBIDvL Cg0h2ef27soKUmjF9rM1zeAw9vZ2zm6DNLVOBLaVDp/X+uhNnFij274BJs2YZlxuJS yyaFpPtamdQh/hsZeF7/RPmW2aHzzLKYO45W/MOmkz9hPfTgVcc007OSfbHjD6lrY9 /9NW9EKyv5vent57cwmH7UTlh09hIpdG6cgoTRwO30ZQHbxPiUGeiR4qZCUwi862qG KmxXpQ1CgMR0g== From: da.gomez@kernel.org Date: Thu, 06 Feb 2025 10:44:20 +0000 Subject: [PATCH v3 3/4] ansible_cfg: add callback plugin cli support Precedence: bulk X-Mailing-List: kdevops@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250206-ansible_cfg3-v3-3-4588c8c07e22@samsung.com> References: <20250206-ansible_cfg3-v3-0-4588c8c07e22@samsung.com> In-Reply-To: <20250206-ansible_cfg3-v3-0-4588c8c07e22@samsung.com> To: Luis Chamberlain , Chuck Lever Cc: kdevops@lists.linux.dev, Daniel Gomez X-Mailer: b4 0.14.2 From: Daniel Gomez To be able to change the Ansible Configuration File callback plugin via cli. Example: make defconfi-* ANSIBLE_CFG_CALLBACK_PLUGIN="debug" Signed-off-by: Daniel Gomez --- kconfigs/Kconfig.ansible_cfg | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/kconfigs/Kconfig.ansible_cfg b/kconfigs/Kconfig.ansible_cfg index bf09c368d85ece4d1272dbe378e1c283c9f57b89..7286b0fe502521835a2dada19b9d59207fc37b94 100644 --- a/kconfigs/Kconfig.ansible_cfg +++ b/kconfigs/Kconfig.ansible_cfg @@ -1,7 +1,12 @@ +config ANSIBLE_CFG_CALLBACK_PLUGIN_SET_BY_CLI + bool + default $(shell, scripts/check-cli-set-var.sh ANSIBLE_CFG_CALLBACK_PLUGIN) + menu "Ansible Callback Plugin Configuration" choice prompt "Ansible Callback Plugin" - default ANSIBLE_CFG_CALLBACK_PLUGIN_DENSE + default ANSIBLE_CFG_CALLBACK_PLUGIN_DENSE if !ANSIBLE_CFG_CALLBACK_PLUGIN_SET_BY_CLI + default ANSIBLE_CFG_CALLBACK_PLUGIN_CUSTOM if ANSIBLE_CFG_CALLBACK_PLUGIN_SET_BY_CLI config ANSIBLE_CFG_CALLBACK_PLUGIN_DEBUG bool "Ansible Debug Callback Plugin" @@ -13,13 +18,28 @@ config ANSIBLE_CFG_CALLBACK_PLUGIN_DENSE help Dense: https://docs.ansible.com/ansible/latest/collections/community/general/dense_callback.html +config ANSIBLE_CFG_CALLBACK_PLUGIN_CUSTOM + bool "Custom Ansible Callback Plugin" + help + This will let you enter in your own Ansible callback plugin + endchoice +if ANSIBLE_CFG_CALLBACK_PLUGIN_CUSTOM + +config ANSIBLE_CFG_CALLBACK_PLUGIN_CUSTOM_NAME + string "Custom Ansible Callback Plugin Name" + default $(shell, ./scripts/append-makefile-vars.sh $(ANSIBLE_CFG_CALLBACK_PLUGIN)) if ANSIBLE_CFG_CALLBACK_PLUGIN_SET_BY_CLI + default "dense" if !ANSIBLE_CFG_CALLBACK_PLUGIN_SET_BY_CLI + +endif # ANSIBLE_CFG_CALLBACK_PLUGIN_CUSTOM + config ANSIBLE_CFG_CALLBACK_PLUGIN_STRING string output yaml default "debug" if ANSIBLE_CFG_CALLBACK_PLUGIN_DEBUG default "dense" if ANSIBLE_CFG_CALLBACK_PLUGIN_DENSE + default ANSIBLE_CFG_CALLBACK_PLUGIN_CUSTOM_NAME if ANSIBLE_CFG_CALLBACK_PLUGIN_CUSTOM config ANSIBLE_CFG_CALLBACK_PLUGIN_CHECK_MODE_MARKERS bool "check_mode_markers" From patchwork Thu Feb 6 10:44:21 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Gomez X-Patchwork-Id: 13962799 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9A7FF18B03 for ; Thu, 6 Feb 2025 10:44:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738838687; cv=none; b=Oyst54UVmthFpzz4LkDGAo5W90KGL9vtWFLFC05qJ+cgUoScLGs2pA+4DnunJPVvz/7EIA+6gDApjgdJFbGGGOvPTqofcw3I7WKS6XOtAYzbsbBB+wUY8GkPi0yDCYewCGW6NfkafP9BxSsqh/J2li1GydmmDepFLQd1oh7V2Xg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738838687; c=relaxed/simple; bh=9i1twqoSu8M2alMf8Ac2Tff0LELGotcKcP4L3aVJC/c=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=gRePAQFyub/JOTA4U34B8h2bUQxV5gZB22i8d1uZzqojGZP363+M77fUzdyWuk+xRhqQiicKf3r9W++MKQLNmJNtXdMHVrO1zCVUSrNZ5hcNkA7C55yT2IxmnUQAawy7B/fD1bZdMKPKh63JwMfiRWiIFDJyuVe03eLrLKZeQBw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=EuXGnz9J; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="EuXGnz9J" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 49C1AC4CEDD; Thu, 6 Feb 2025 10:44:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1738838687; bh=9i1twqoSu8M2alMf8Ac2Tff0LELGotcKcP4L3aVJC/c=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=EuXGnz9J16WXWEMc+mp/Jl1zJwvP1bah+6Y1I0pHba+YCt/b+ILQQwGpHuyBs/DWJ JHzywjAulTrqr6gZ2mWrS+q058VNsMa20waN02DHH8Nou1upNmyTgeUeuW3R0sjDlO f3fMo0w/YeDL4hoj3MBsz27RgOtJ6OpxRbgCziHpciu/yTXCuzxkvr10cJ4x821o6E myCG4Cw2p6cAI1soXXJg9vPPkfW9zb5PjAuPnHDEBaA7O6YBceQ4btLRrdPLjY3xCj TsWHZHgvcbjvIx+K8Mkm+ZiUynIzDg8cLWnwhpj18gYztbai9LT5PMPfVyYIpCWvCx wHZ2rSkcmv9Sw== From: da.gomez@kernel.org Date: Thu, 06 Feb 2025 10:44:21 +0000 Subject: [PATCH v3 4/4] github/workflows/fstests.yml: use debug callback plugin Precedence: bulk X-Mailing-List: kdevops@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250206-ansible_cfg3-v3-4-4588c8c07e22@samsung.com> References: <20250206-ansible_cfg3-v3-0-4588c8c07e22@samsung.com> In-Reply-To: <20250206-ansible_cfg3-v3-0-4588c8c07e22@samsung.com> To: Luis Chamberlain , Chuck Lever Cc: kdevops@lists.linux.dev, Daniel Gomez X-Mailer: b4 0.14.2 From: Daniel Gomez Use the new cli ANSIBLE_CFG_CALLBACK_PLUGIN to configure the debug callback plugin for CI. This keeps the output same level of verbosity for CI, before we change the default to dense. An alternative is to keep it dense but increase the Ansible verbosity level with AV= makefile parameter. Signed-off-by: Daniel Gomez --- .github/workflows/fstests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/fstests.yml b/.github/workflows/fstests.yml index 0cff94ab64aa6aa78cae9db6ed921cc24d9c3dac..4aeb2943546489bf0d91862a0f87cefb43d68454 100644 --- a/.github/workflows/fstests.yml +++ b/.github/workflows/fstests.yml @@ -39,6 +39,7 @@ jobs: KDEVOPS_TREE_REF="${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}" SHORT_PREFIX="$(echo ${KDEVOPS_TREE_REF:0:12})" make KDEVOPS_HOSTS_PREFIX="$SHORT_PREFIX" defconfig-xfs_reflink_4k + ANSIBLE_CFG_CALLBACK_PLUGIN="debug" - name: Run kdevops make run: |