From patchwork Mon Feb 3 15:55:17 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Gomez X-Patchwork-Id: 13957747 Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) (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 51E75209F5C for ; Mon, 3 Feb 2025 15:55:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=210.118.77.12 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738598139; cv=none; b=URWjD4c8p36/u9a9CJRa7sVYA2Dt5gtqiDU3INC4rmLaWuD+yVIe6CNAmvF+0YwDRWKvZ2iliErWVxDOc00nwQ9bx1Jf4N1zNyT5JoUTahZo/7Q4cGV8VKt0aKZK4ikZoOefiAa/IakrI/jByjgRxK//2O1I/jLBt59P7oiSKj8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738598139; c=relaxed/simple; bh=utdQWQ1wP8XGueHAWIcpqAnNrQQvc2lWWkndk3nkwzA=; h=From:Subject:Date:Message-ID:MIME-Version:Content-Type:To:CC: References; b=KJa+vKs7Vqc4zTZL86nPMDN6Uq93HE0aiXDlWewd5DocTYEEUWj51ajJxVLJUWsFb/5Yxjc4edItUA/5gFiQgXw2eRzuw6uXWr3zsyyYj2W4T6kg/RN/D+eI2Zc75B4OOLT2NEnNPYfB9eGw30UuABm3RNCv6iiYfGqYaXgcL+g= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com; spf=pass smtp.mailfrom=samsung.com; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b=P8sNK2Ht; arc=none smtp.client-ip=210.118.77.12 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=samsung.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="P8sNK2Ht" Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20250203155534euoutp02559fcd14a06ed3f75f334cb9ddcac54b~gvcqydu6Q2543625436euoutp02X for ; Mon, 3 Feb 2025 15:55:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20250203155534euoutp02559fcd14a06ed3f75f334cb9ddcac54b~gvcqydu6Q2543625436euoutp02X DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1738598134; bh=Qvl+CjatjLkOtWPPkj69HKywp1OVxhsHfZjWux3VbMk=; h=From:Subject:Date:To:CC:References:From; b=P8sNK2HtdY38boR7IcuVBaVMacBF6aVU8/QlHsVxUGahEB9+hi2kiZZ0iRCO9t0NI LNi3NQYUgMOwOcSwJb6fwh9JSByuPsBCKRcEPMTkz+6ayoX5xfAJEQCv6OGsmO9KKz CvGSnc8kbJZyotmRf104btw9soNNiagV6tLHyB0Y= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20250203155534eucas1p1d889028783c6664bdd484aeb28a885ec~gvcqou-Xi2750427504eucas1p1E; Mon, 3 Feb 2025 15:55:34 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id FD.5E.20409.6F6E0A76; Mon, 3 Feb 2025 15:55:34 +0000 (GMT) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20250203155533eucas1p1f609fe37cd5b68721b7f28f7d6ae77d5~gvcqP8Fk00406904069eucas1p1D; Mon, 3 Feb 2025 15:55:33 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20250203155533eusmtrp2d1f23538efbc245510c7df13f211c736~gvcqPXaU40997709977eusmtrp2Q; Mon, 3 Feb 2025 15:55:33 +0000 (GMT) X-AuditID: cbfec7f4-c39fa70000004fb9-2f-67a0e6f60070 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 7D.EC.19654.5F6E0A76; Mon, 3 Feb 2025 15:55:33 +0000 (GMT) Received: from CAMSPWEXC02.scsc.local (unknown [106.1.227.4]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20250203155533eusmtip22da8c6992cda7c40f5717e73361f12e0~gvcqFk9DI0240002400eusmtip2l; Mon, 3 Feb 2025 15:55:33 +0000 (GMT) Received: from localhost (106.110.32.87) by CAMSPWEXC02.scsc.local (106.1.227.4) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.2.1118.40; Mon, 3 Feb 2025 15:55:33 +0000 From: Daniel Gomez Subject: [PATCH 0/2] ansible.cfg: generate with kconfig Date: Mon, 3 Feb 2025 16:55:17 +0100 Message-ID: <20250203-ansible_cfg3-v1-0-a9e75cd067d7@samsung.com> Precedence: bulk X-Mailing-List: kdevops@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIAOXmoGcC/02OywqDMBBFf0Vm3cBkoo36K0VKHqMNVG0TKwXx3 xt0082Fc+E+NkgcAydoiw0iryGFecogLwW4h5kGFsFnBkKqkFAJM6Vgn3x3/aCEMh5r7olKZSF HXpH78D3qbt3Jkd+f3LqcJliTWLh5HMPSFtaxqZRHLdE51EQVYamQtHZ11oYbZKyvCv7ftMXxR Sop8pbwdhA9l5Z05Rt0ul0ldPv+A1Qq9uvZAAAA X-Change-ID: 20250203-ansible_cfg3-3ad08ef2243b To: Luis Chamberlain CC: , Daniel Gomez X-Mailer: b4 0.15-dev X-Developer-Signature: v=1; a=ed25519-sha256; t=1738598132; l=8393; i=da.gomez@samsung.com; s=20240621; h=from:subject:message-id; bh=utdQWQ1wP8XGueHAWIcpqAnNrQQvc2lWWkndk3nkwzA=; b=T52VpoH9ILSX0VYIKHfULlhFC5haYPeb9+oRE77AIOBl1YvR/ZeMuPW71H4/9tQKgSnI1Ci3u YUh105+/1BEABNzrgmKeLAnfACGFrlDP/TdpuZhM6I8Kw7ZNnxUYWhF X-Developer-Key: i=da.gomez@samsung.com; a=ed25519; pk=BqYk31UHkmv0WZShES6pIZcdmPPGay5LbzifAdZ2Ia4= X-ClientProxiedBy: CAMSVWEXC01.scsc.local (106.1.227.71) To CAMSPWEXC02.scsc.local (106.1.227.4) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrNIsWRmVeSWpSXmKPExsWy7djPc7rfni1IN/g1g8/i55qXzBY3Jjxl dGDy2LSqk83jxeaZjAFMUVw2Kak5mWWpRfp2CVwZ24+6FZx2rNjR+YKtgfG5cRcjJ4eEgInE qu+b2LsYuTiEBFYwSvze8J0NwvnCKHGs6QCU85lRovX2TZYuRg6wlvapFhDx5YwSM7q2M0M4 nxglDp48xgrhPGCUeLOviwVkCZuApsS+kyBLODmEBcwl5kzsA7NZBFQklk5rYwOZyivgKHF0 VwZImFdAUOLkzCdgy5iBWtfv0gcJMwvIS2x/Owdsl4RAP5PE+zuLmSF+0JfYvHoNK4gtIqAh sW9CLxNEg5PEyUlX2SBqRCV+T97FAtG8n0li5fa5LBCJVIkVj+5ADVKUmDFxJdSXSRKNL1Ih 6i9wSCy9e4odosZFYuP3nUwQtrDEq+NboOIyEv93zoeKZ0uc/b6HEcIukfj34RfULmuJ/2vv QsUdJV7uuMo6gVF9FpKfZyH8PAvJzwsYmVcxiqeWFuempxYb5aWW6xUn5haX5qXrJefnbmIE pofT/45/2cG4/NVHvUOMTByMhxglO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GppZqwkzst25XyakEB6YklqdmpqQWoRTB8TB6dU A5P+ScZ/x7UiEzqW2fAtXZDfZJGxNDj9/akbiae+8GnsfMhYE9VufnZPxJ+8O7dDu9e5TrNd yanee0C6maXMLmLG9VXJ06NZg/gOGTMkzA0QLGp45P/Z703FLNEXado9699tT/ucv33SK7P5 E/41q/wu2miR3yRedGifxefzJ8P3P9I5tLf240unE+5BGSYbVopEnF04596KubecrWZWuwbF zwh7n1Kvx/GtdPenFTsO37Y3S50o1a2ryfjc6qJZF99i11lpd7i83O/WfHo+eWlSU0dPt5T0 VKtTmx9M36/hmnfWY8+j1uT6RbwVRyYYmLmcEEy1bbnO6Bl32jHylbH816oKnaV9p8KeZoh3 OCmxFGckGmoxFxUnAgAuL1RHPgMAAA== X-CMS-MailID: 20250203155533eucas1p1f609fe37cd5b68721b7f28f7d6ae77d5 X-Msg-Generator: CA X-RootMTR: 20250203155533eucas1p1f609fe37cd5b68721b7f28f7d6ae77d5 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20250203155533eucas1p1f609fe37cd5b68721b7f28f7d6ae77d5 References: This series will generate the current in-tree ansible.cfg (Ansible Configuration Settings) based on kconfig user options (kconfig menu location: Kdevops configuration -> Ansible Configuration ->). Add ansible.cfg Makefile target to manually generate the file, but also append the target to the list of default make targets to make sure the configuration file is generated. The first commit just keeps the ansible.cfg as is. The second changes the current settings to: * Use dense [1] callback plugin instead of debug. This ensure a more readable stdout convenient for normal operation. For CI, I recommend setting AV=2 (Ansible Verbosity: -vv) or enable the debug plugin. For error/debug user situations, or kdevops/Ansible development, re-run your failed playbook with AV=1 or more. Index of callback plugins can be found here: https://docs.ansible.com/ansible/latest/collections/index_callback.html Note: More updated settings below the examples. Example running dense callback plugin with default Ansible verbosity (AV=0 or nothing): make V=1 bringup ... ansible-playbook --connection=local \ --inventory localhost, \ playbooks/gen_nodes.yml \ -e 'ansible_python_interpreter=/usr/bin/python3' \ --extra-vars=@./extra_vars.yaml PLAY 1: LOCALHOST task 1. [started TASK: Gathering Facts on localhost] task 2. [started TASK: gen_nodes : Import optional extra_args file on localhost] task 3. [started TASK: gen_nodes : Get our user on localhost] task 3: localhost task 4. [started TASK: gen_nodes : Get our primary group on localhost] task 4: localhost ... Example running dense callback plugin with Ansible verbosity level 1 (AV=1): make V=1 AV=1 bringup ... ansible-playbook -v --connection=local \ --inventory localhost, \ playbooks/gen_nodes.yml \ -e 'ansible_python_interpreter=/usr/bin/python3' \ --extra-vars=@./extra_vars.yaml Using /media/tarkir/dagomez/src/linux-kdevops/kdevops/ansible.cfg as config file PLAY 1: LOCALHOST task 1. [started TASK: Gathering Facts on localhost] task 2. [started TASK: gen_nodes : Import optional extra_args file on localhost] task 3. [started TASK: gen_nodes : Get our user on localhost] task 3: gen_nodes : Get our user changed: localhost: {"changed": true, "cmd": ["whoami"], "rc": 0, "stdout": "dagomez"} task 4. [started TASK: gen_nodes : Get our primary group on localhost] task 4: gen_nodes : Get our primary group changed: localhost: {"changed": true, "cmd": ["id", "-g", "-n"], "rc": 0, "stdout": "dagomez"} ... Example running dense callback plugin with default verbosity (AV=0), error situation (error is "forced"/"simulated"): make V=1 bringup make linux-clone PLAY 1: LOCALHOST 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 --connection=local \ --inventory localhost, \ playbooks/gen_nodes.yml \ -e 'ansible_python_interpreter=/usr/bin/python3' \ --extra-vars=@./extra_vars.yaml PLAY 1: LOCALHOST task 1. [started TASK: Gathering Facts on localhost] task 2. [started TASK: gen_nodes : Import optional extra_args file on localhost] task 3. [started TASK: gen_nodes : Get our user on localhost] task 3: localhost task 4. [started TASK: gen_nodes : Get our primary group on localhost] task 4: localhost task 5. [started TASK: gen_nodes : Create guestfs directory on localhost] task 5: localhost make[1]: *** [Makefile:235: guestfs/kdevops_nodes.yaml] Error 2 make: *** [scripts/guestfs.Makefile:55: 9p_linux_clone] Error 2 Example running dense callback plugin with verbosity level 1 (AV=1), error situation (error is "forced"/"simulated"): make V=1 AV=1 bringup make linux-clone Using /media/tarkir/dagomez/src/linux-kdevops/kdevops/ansible.cfg as config file PLAY 1: LOCALHOST 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] SUMMARY localhost : ok=3 changed=0 unreachable=0 failed=0 rescued=0 ignored=0 ansible-playbook -v --connection=local \ --inventory localhost, \ playbooks/gen_nodes.yml \ -e 'ansible_python_interpreter=/usr/bin/python3' \ --extra-vars=@./extra_vars.yaml Using /media/tarkir/dagomez/src/linux-kdevops/kdevops/ansible.cfg as config file PLAY 1: LOCALHOST task 1. [started TASK: Gathering Facts on localhost] task 2. [started TASK: gen_nodes : Import optional extra_args file on localhost] task 3. [started TASK: gen_nodes : Get our user on localhost] task 3: gen_nodes : Get our user changed: localhost: {"changed": true, "cmd": ["whoami"], "rc": 0, "stdout": "dagomez"} task 4. [started TASK: gen_nodes : Get our primary group on localhost] task 4: gen_nodes : Get our primary group changed: localhost: {"changed": true, "cmd": ["id", "-g", "-n"], "rc": 0, "stdout": "dagomez"} task 5. [started TASK: gen_nodes : Create guestfs directory on localhost] task 5: gen_nodes : Create guestfs directory failed: localhost: {"msg": "The task includes an option with an undefined variable.. 'guestfs_path_err' is undefined\n\nThe error appears to be in '/media/tarkir/dagomez/src/linux-kdevops/kdevops/playbooks/roles/gen_nod es/tasks/main.yml': line 21, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: Create guestfs directory\n ^ here\n"} SUMMARY localhost : ok=4 changed=2 unreachable=0 failed=1 rescued=0 ignored=0 make[1]: *** [Makefile:235: guestfs/kdevops_nodes.yaml] Error 2 make: *** [scripts/guestfs.Makefile:55: 9p_linux_clone] Error 2 * Enable show_per_host_start [3] parameter. This is a common parameter between dense and debug callback plugins. Allows to know which task is being executed rather than the current behaviour which only displays terminated tasks. * show_task_path_on_failure [4] parameter. Another commomn parameter between dense and debug callback plugins. Allows to see the path and file of the failure task when debug is -vv or greater. [1] https://docs.ansible.com/ansible/latest/collections/community/general/dense_callback.html [2] https://docs.ansible.com/ansible/latest/collections/ansible/posix/debug_callback.html#ansible-collections-ansible-posix-debug-callback [3] https://docs.ansible.com/ansible/latest/collections/community/general/dense_callback.html#parameter-show_per_host_start [4] https://docs.ansible.com/ansible/latest/collections/community/general/dense_callback.html#parameter-show_per_host_start Signed-off-by: Daniel Gomez --- Daniel Gomez (2): ansible.cfg: autogenerate using kconfig ansible.cfg: change defaults to minimal .gitignore | 2 + MAINTAINERS | 4 + Makefile | 17 +++- ansible.cfg | 5 - kconfigs/Kconfig.ansible_cfg | 105 +++++++++++++++++++++ kconfigs/Kconfig.kdevops | 4 + playbooks/ansible_cfg.yml | 4 + playbooks/roles/ansible_cfg/defaults/main.yml | 9 ++ playbooks/roles/ansible_cfg/tasks/main.yml | 17 ++++ .../roles/ansible_cfg/templates/ansible.cfg.j2 | 14 +++ 10 files changed, 172 insertions(+), 9 deletions(-) --- base-commit: bcea53d0710cc0722520430277c80279e90e0863 change-id: 20250203-ansible_cfg3-3ad08ef2243b prerequisite-change-id: 20250131-fix-dbg-fe4b275d90c7:v1 prerequisite-patch-id: dcbe4e784cf81c8863050d2829598e131b51a7ff prerequisite-patch-id: 149905762e9801eb6da1872f6751cf430b9f0dda prerequisite-patch-id: 8ea8b7694168bdae29156ab0c4696f0bac47815d Best regards,