From patchwork Sat Mar 29 23:01:36 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luis Chamberlain X-Patchwork-Id: 14032811 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 041D02B2D7 for ; Sat, 29 Mar 2025 23:01:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.133 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743289304; cv=none; b=RjKO5b6Jczk6kUXbVTOkkVHdDLd3Jn3XHsZy2E0DdHUXmbWrxmKY+QvusTVFWz0AAib9/EJhjptz65aIDXwxEu257SzWF0JvtgjZ2HTUYdgKQQZ5ZWyH7GQdmv6bOMODourhZYLedWB9+Fa4xwieMO7G9Q7Ja0yBRY+PINLJ1mM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743289304; c=relaxed/simple; bh=bz8wSpwgWatBt5higMV2tnX2KKGrCeF/GNkag05rQmE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=qHzT4nQiBcmD0mQ375h4LUc8Qgph41FGaLpomfVPLAK+X/3xNxI7GRJgc/+yYcUQ2jcH06/1d0LgGdHUifEwyajw0x4K7hCQB2b28dgmQWlE270RbUF9S588/lR4bzfFwoubjsCctk/VdeWaEWfigjQCqzNcLqxLDUwn6j5paB0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=kernel.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=InWBm4ol; arc=none smtp.client-ip=198.137.202.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="InWBm4ol" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Sender:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description; bh=NtuEC3ZPrYAlBXsv7tD0SUG6kw7MWYGloSo9ctrn+ss=; b=InWBm4ol7AS4fbXFNe9bWMu2kw oNPmzc/gH0XNivRQuhL/9uWjIPu2d1G/5fdl55m5ySNJFmPHP0W5DbE5cLtoLpl6okoBjF0E6raWL f6fk7orDmDPtfg0/2qWountLjo/ShWHWL+5alDwxGS8/GW8iByb3HjE2U2wWn4dnHgpZuocoY3V+C hcRszvGWmXxlDV8QQCs/LckDU5e7XMGw+4pWjHOmrYH51GDDXrFy75dcG1EBc8TyN8XRPDVo7PqwM h/R+TRxdvodhgmMkC9h47k/5hRHjQCJXpWthNcbS/Z+WBY0LXWgc1W0aqo9iBhIxPz7d+VaKTn8gO D7/Aw5BQ==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.98.1 #2 (Red Hat Linux)) id 1tyfBO-0000000FbIV-1af1; Sat, 29 Mar 2025 23:01:42 +0000 From: Luis Chamberlain To: kdevops@lists.linux.dev Cc: Luis Chamberlain Subject: [PATCH 1/6] scripts/bringup_guestfs.sh: uninstall unattended-upgrades on debian guests Date: Sat, 29 Mar 2025 16:01:36 -0700 Message-ID: <20250329230141.3718282-2-mcgrof@kernel.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250329230141.3718282-1-mcgrof@kernel.org> References: <20250329230141.3718282-1-mcgrof@kernel.org> Precedence: bulk X-Mailing-List: kdevops@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Sender: Luis Chamberlain Be sure to remove unattended-upgrades when taking the downloaded image from Debian to build our base image which we will use to launch guests with. The package unattended-upgrades [0] is one of the biggest pain points for continous integeration on kdevops, where we race against package installations being mucked behind our back. So let's just be extremely vocal about it being a requirement to not be installed on debian systems and complain and ensure systems don't have it. Even though we have already in place devconfig rules to remove it, upon first bringup you can still race against it! If you do have an old guest with it, you should just remove the old guest and re-do your new guest as otherwise you will encounter many odd silly bugs and the issue is just races with debian doing its upgrades with unattended-upgrades. To my surprise unattended-upgrades has also been a default on debian for years now, it would seem we can just move to a debian image of "netinst" or "minimal" images but that requires more work than what we can just do by removing the package. Long term we really should request to see if is debian folks can ends up packaging a proper guestfs image based on debian testing for us, and when that does happen we ask it does not have unattended-upgrades. [0] https://wiki.debian.org/UnattendedUpgrades Signed-off-by: Luis Chamberlain --- scripts/bringup_guestfs.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/bringup_guestfs.sh b/scripts/bringup_guestfs.sh index 7166842307b5..1ba2c8c6ff9a 100755 --- a/scripts/bringup_guestfs.sh +++ b/scripts/bringup_guestfs.sh @@ -223,6 +223,7 @@ firstboot-command systemctl stop ssh firstboot-command DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true dpkg-reconfigure -p low --force openssh-server firstboot-command systemctl start ssh firstboot-command apt update && apt upgrade --yes +uninstall unattended-upgrades _EOT # CONFIG_GUESTFS_COPY_SOURCES_FROM_HOST_TO_GUEST will not work # if /etc/nsswitch.conf has a line like this: From patchwork Sat Mar 29 23:01:37 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luis Chamberlain X-Patchwork-Id: 14032815 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 0425413A87C for ; Sat, 29 Mar 2025 23:01:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.133 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743289305; cv=none; b=gjSq5XfdSaQITPqalr5jVsqIWoP9ZeZhwmhEmlHYsygSCkLQnL3v6jhHVCC3fOG46gWOe7kLV6xWmveGr0yw4ViaxFgUK+2SGYib+mT9fpSWW+W//wEmEN9Yd9fQfRRz+wSi4939TeVgkISqiATpaQrzeqae7WO5NspwjpuEnjI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743289305; c=relaxed/simple; bh=dZWYusjO/ymIqYGVxXVNWbNQ6QXiXsOilpm+Aleh15s=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rP1kF1HFsdJ5d4iHoVVQ4qqZcuJ75dpNpa8RXYzYZCfQtEBKT2k97bVe7gehW2EUI4DgENLkTHakwLLs5NC3G4VibBgWOoetqrFemtS12kQ0FIUuXvRZXH+1ONFQlpBqJJHLkr/1AVv572k/Z/MLAlysBDv/k3wIGe3vw4dUEFg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=kernel.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=E2FuAwEN; arc=none smtp.client-ip=198.137.202.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="E2FuAwEN" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Sender:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description; bh=czTjTimS9U+dskd17eU8lDE1DzSBbhQ31GKvaGBVjjY=; b=E2FuAwEN7VTEGmB1XT4fmIBgSE fCi4Z1Z89gp2yuOAYg+/uacKF3NT10/gwkAO3WS3bhPn/akYwIFiwGPtJd3M7BupFqugTjMbFmHs1 /SfinonJn+PzidwBciREaU+257zftT9juvWkNbSZKKdtfHF3uTjGtNRGhRkFJpSDbCG5mV3AdERGN RTGixr9uJYSDhsZ07QZu6Od+9kuasEpCQM+wKXo0JyuVCvll5vyCuwJhW9rbPbPSdSCPBFWzOR1US xPVXBQJS5ZrcpnIi3cN2Ssgxdn1m9DBU/sljv9n8xmLr5hJGJdDpvosY4QHjuSJrGvpOBqcvPZ6le WcMu+z0w==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.98.1 #2 (Red Hat Linux)) id 1tyfBO-0000000FbIX-1i3H; Sat, 29 Mar 2025 23:01:42 +0000 From: Luis Chamberlain To: kdevops@lists.linux.dev Cc: Luis Chamberlain Subject: [PATCH 2/6] devconfig: ensure unattended-upgrades is not installed on debian Date: Sat, 29 Mar 2025 16:01:37 -0700 Message-ID: <20250329230141.3718282-3-mcgrof@kernel.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250329230141.3718282-1-mcgrof@kernel.org> References: <20250329230141.3718282-1-mcgrof@kernel.org> Precedence: bulk X-Mailing-List: kdevops@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Sender: Luis Chamberlain We already remove the package on debian bringups when downloading a an official but-not-guestfs-official (and so debian custom) image to build our base images for our guests. Now that we have that stop-gap measure, be sure we just fail if the package happens to be installed, and complain to the user about it. We can easily fix this with just two command so recommend that. Signed-off-by: Luis Chamberlain --- .../tasks/install-deps/debian/main.yml | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/playbooks/roles/devconfig/tasks/install-deps/debian/main.yml b/playbooks/roles/devconfig/tasks/install-deps/debian/main.yml index 5624a9f8406a..954f0aede3b2 100644 --- a/playbooks/roles/devconfig/tasks/install-deps/debian/main.yml +++ b/playbooks/roles/devconfig/tasks/install-deps/debian/main.yml @@ -1,4 +1,26 @@ --- +- name: Check if unattended-upgrades is installed + command: dpkg-query -W -f='${Status}' unattended-upgrades + register: unattended_upgrade_status + ignore_errors: true + changed_when: false + +- name: Set fact if unattended-upgrades is installed + set_fact: + unattended_upgrades_installed: "{{ 'install ok installed' in unattended_upgrade_status.stdout }}" + +- name: Verify unattended-upgrades is not installed + fail: + msg: | + The unattended-upgrades package is installed on the base image, this + can cause tons of issues with CIs. Fix this by running the following + commands: + + make cleancache + make bringup + when: + - unattended_upgrades_installed|bool + - name: Upgrade Packages become: yes become_method: sudo From patchwork Sat Mar 29 23:01:38 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luis Chamberlain X-Patchwork-Id: 14032814 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 0419B29A1 for ; Sat, 29 Mar 2025 23:01:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.133 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743289305; cv=none; b=MO9JrnCNqbH5zUb1qS9AFYh3c1BDPXnnEdb6XOP//8fEBxpGIx988PbrYqspR6oPWo605RNH0SKrPWX2GnAkB69dlE6RJiEEeAHi5e/mii1ipe0ku+a/qD30iQBROPrdwDN6ZRuHkVEn8hYWTADNR/Dvf45SHf9DuRxG75VOXCk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743289305; c=relaxed/simple; bh=meUJJO/7jb9N//HuLU92FSAfHrNRjKQpkvfoWvmP5So=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=trto0Rc5ljcfeMAyf+7qusOuj/bpBM3gz4l5V3dWOMNFseQypaCDB0HPimmpquE3ucbH8RRZcEwA41xtok92Phk9QCOr0zKpyS0LAt4wNuhRfq2X3Cl1aCedKnjjVloTUY3oWzyKVkpmS17VnDBBTPBK1CimRxIjygv2pHlX2Sc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=kernel.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=hGV3onx1; arc=none smtp.client-ip=198.137.202.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="hGV3onx1" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Sender:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description; bh=ULtyErPN+paO8IDInhHoEDNnCdGiDPBUDPbUIfzRYgA=; b=hGV3onx15aYJnFzOHS45WpH+2w By66UD8ukJ76L60p2+BGQJheiBmftX1Lol6HsszuFzUD+sXhU7ByTkcLZ9l4uIBuSvIUD17r1k+Nw g8TuVomwMNO0QjVVOu/xER0nyteOKqy/ORDYvvHvr++CVf2HZAvI6drdgYs5F++HzafCcCaE/SR50 aUUykS6wMG6rTrO1EauoehG8u6YgRy0RyKIZV3T4hmRl1haoN51rN+gt3eiZJXDqGzwWLZ65NbeSi 5j3H/5BClaqM7EUhjrajs4xBNCevz/DrDMxqTrE++Usb8XGjxod2I6YHAJpJvJRFmgON5i1/JiAvo EDSziSAg==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.98.1 #2 (Red Hat Linux)) id 1tyfBO-0000000FbIZ-1pLh; Sat, 29 Mar 2025 23:01:42 +0000 From: Luis Chamberlain To: kdevops@lists.linux.dev Cc: Luis Chamberlain Subject: [PATCH 3/6] libvirt: use consistent pool path variables and use optional yaml output Date: Sat, 29 Mar 2025 16:01:38 -0700 Message-ID: <20250329230141.3718282-4-mcgrof@kernel.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250329230141.3718282-1-mcgrof@kernel.org> References: <20250329230141.3718282-1-mcgrof@kernel.org> Precedence: bulk X-Mailing-List: kdevops@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Sender: Luis Chamberlain Turns out we define CONFIG_KDEVOPS_STORAGE_POOL_PATH only to make it be the same as generic CONFIG_LIBVIRT_STORAGE_POOL_PATH only later to then use the old GUESTFS_ARGS or VAGRANT_ARGS to define the yaml version with a postfix "kdevops". Fix all this mess by using yaml output and cleaing its use up. This does not fix any bugs, it just make things consistent. And so where you saw CONFIG_KDEVOPS_STORAGE_POOL_PATH we now just use the generic version CONFIG_LIBVIRT_STORAGE_POOL_PATH. The kconfig symbol CONFIG_KDEVOPS_STORAGE_POOL_PATH gets promoted to be what we expect it, that is: "{{ libvirt_storage_pool_path }}/kdevops" This also ensure we will barf as we want to promote using ansible for this anyway and do away with all of the CONFIG_KDEVOPS_STORAGE_POOL_PATH uses in shell scripts. This kills all use of CONFIG_KDEVOPS_STORAGE_POOL_PATH from shell scripts too then. The motivation for all this is to slowly trim away the large error-prone script scripts/bringup_guestfs.sh into ansible. This is just a small step towards making that easier. Signed-off-by: Luis Chamberlain --- kconfigs/Kconfig.guestfs | 5 +++++ kconfigs/Kconfig.libvirt | 11 ++++++++++- scripts/bringup_guestfs.sh | 2 +- scripts/bringup_vagrant.sh | 2 +- scripts/destroy_guestfs.sh | 2 +- scripts/destroy_vagrant.sh | 2 +- scripts/gen-nodes.Makefile | 6 ------ scripts/guestfs.Makefile | 7 +------ scripts/prune_stale_vagrant.sh | 2 +- scripts/vagrant.Makefile | 5 ----- 10 files changed, 21 insertions(+), 23 deletions(-) diff --git a/kconfigs/Kconfig.guestfs b/kconfigs/Kconfig.guestfs index f618fc30fe25..c6d2d1907dd5 100644 --- a/kconfigs/Kconfig.guestfs +++ b/kconfigs/Kconfig.guestfs @@ -1,5 +1,10 @@ if GUESTFS +config STORAGE_POOL_PATH + string + output yaml + default LIBVIRT_STORAGE_POOL_PATH + config GUESTFS_HAS_CUSTOM_RAW_IMAGE bool diff --git a/kconfigs/Kconfig.libvirt b/kconfigs/Kconfig.libvirt index 1ed967423096..cba8abf1e24b 100644 --- a/kconfigs/Kconfig.libvirt +++ b/kconfigs/Kconfig.libvirt @@ -155,13 +155,20 @@ config LIBVIRT_QEMU_GROUP default "qemu" if !DISTRO_DEBIAN && !DISTRO_UBUNTU default "libvirt-qemu" if DISTRO_DEBIAN || DISTRO_UBUNTU -config KDEVOPS_STORAGE_POOL_PATH + +config LIBVIRT_STORAGE_POOL_PATH string + output yaml default LIBVIRT_STORAGE_POOL_PATH_AUTO if LIBVIRT && !LIBVIRT_STORAGE_POOL_PATH_CUSTOM_MANUAL default LIBVIRT_STORAGE_POOL_PATH_AUTO if LIBVIRT && LIBVIRT_STORAGE_POOL_PATH_CUSTOM_CWD default LIBVIRT_STORAGE_POOL_PATH_CUSTOM if LIBVIRT && LIBVIRT_STORAGE_POOL_PATH_CUSTOM_MANUAL default VIRTUALBOX_STORAGE_POOL_PATH_CUSTOM if VAGRANT_VIRTUALBOX +config KDEVOPS_STORAGE_POOL_PATH + string + output yaml + default "{{ libvirt_storage_pool_path }}/kdevops" + config QEMU_BIN_PATH string default QEMU_BIN_PATH_LIBVIRT if LIBVIRT @@ -1052,6 +1059,7 @@ endif config LIBVIRT_STORAGE_POOL_CREATE bool "Should we build a custom storage pool for you?" + output yaml default n if !LIBVIRT_STORAGE_POOL_PATH_INFER_ADVANCED default $(shell, ./scripts/get_libvirsh_pool_enabled.sh) if LIBVIRT_STORAGE_POOL_PATH_INFER_ADVANCED help @@ -1063,6 +1071,7 @@ config LIBVIRT_STORAGE_POOL_CREATE config LIBVIRT_STORAGE_POOL_NAME string "Libvirt storage pool name" + output yaml depends on LIBVIRT_STORAGE_POOL_CREATE default "default" if !LIBVIRT_STORAGE_POOL_PATH_INFER_ADVANCED default $(shell, ./scripts/get_libvirsh_pool_name.sh) if LIBVIRT_STORAGE_POOL_PATH_INFER_ADVANCED diff --git a/scripts/bringup_guestfs.sh b/scripts/bringup_guestfs.sh index 1ba2c8c6ff9a..976d1e78ed6a 100755 --- a/scripts/bringup_guestfs.sh +++ b/scripts/bringup_guestfs.sh @@ -14,7 +14,7 @@ IMG_FMT="qcow2" if [ "${CONFIG_LIBVIRT_EXTRA_DRIVE_FORMAT_RAW}" = "y" ]; then IMG_FMT="raw" fi -STORAGETOPDIR="${CONFIG_KDEVOPS_STORAGE_POOL_PATH}" +STORAGETOPDIR="${CONFIG_LIBVIRT_STORAGE_POOL_PATH}" STORAGEDIR="${STORAGETOPDIR}/kdevops/guestfs" QEMU_GROUP=$CONFIG_LIBVIRT_QEMU_GROUP GUESTFSDIR="${TOPDIR}/guestfs" diff --git a/scripts/bringup_vagrant.sh b/scripts/bringup_vagrant.sh index 4d30c2312000..4e163871d482 100755 --- a/scripts/bringup_vagrant.sh +++ b/scripts/bringup_vagrant.sh @@ -55,7 +55,7 @@ vagrant_check_dups() # instances *and* we know one does not exist in another # directory for this user. - kdevops_pool_path="$CONFIG_KDEVOPS_STORAGE_POOL_PATH" + kdevops_pool_path="$CONFIG_LIBVIRT_STORAGE_POOL_PATH" # For libvirt we can do one more global sanity check if [[ "$CONFIG_LIBVIRT" == "y" ]]; then possible_image="${kdevops_pool_path}/vagrant_${instance}.img" diff --git a/scripts/destroy_guestfs.sh b/scripts/destroy_guestfs.sh index 58dca78d85cf..ee5dc2b57d6d 100755 --- a/scripts/destroy_guestfs.sh +++ b/scripts/destroy_guestfs.sh @@ -7,7 +7,7 @@ source ${TOPDIR}/scripts/lib.sh export LIBVIRT_DEFAULT_URI=$CONFIG_LIBVIRT_URI -STORAGEDIR="${CONFIG_KDEVOPS_STORAGE_POOL_PATH}/kdevops/guestfs" +STORAGEDIR="${CONFIG_LIBVIRT_STORAGE_POOL_PATH}/kdevops/guestfs" GUESTFSDIR="${TOPDIR}/guestfs" if [ -f "$GUESTFSDIR/kdevops_nodes.yaml" ]; then diff --git a/scripts/destroy_vagrant.sh b/scripts/destroy_vagrant.sh index 4e5bb9d64bef..bd5e43d0044e 100755 --- a/scripts/destroy_vagrant.sh +++ b/scripts/destroy_vagrant.sh @@ -18,7 +18,7 @@ rm -rf .vagrant # doing so we don't check for global dups or anything like that. UNINIT_CURRENT_INSTANCES=$(vagrant status --machine-readable | grep ",state," | grep not_created | awk -F "," '{print $2}') for i in $UNINIT_CURRENT_INSTANCES; do - UNINIT_INSTANCE_SPARE_DRIVE_DIR="${CONFIG_KDEVOPS_STORAGE_POOL_PATH}/kdevops/$i" + UNINIT_INSTANCE_SPARE_DRIVE_DIR="${CONFIG_LIBVIRT_STORAGE_POOL_PATH}/kdevops/$i" if [[ -d $UNINIT_INSTANCE_SPARE_DRIVE_DIR ]]; then echo "Found unitialized (possibly old) instance spare drive directory, removing it ... $i" rm -rf $UNINIT_INSTANCE_SPARE_DRIVE_DIR diff --git a/scripts/gen-nodes.Makefile b/scripts/gen-nodes.Makefile index 8bee2db57591..775ec5c49808 100644 --- a/scripts/gen-nodes.Makefile +++ b/scripts/gen-nodes.Makefile @@ -42,12 +42,6 @@ GEN_NODES_EXTRA_ARGS += libvirt_session_management_network_device='$(subst ",,$( GEN_NODES_EXTRA_ARGS += libvirt_session_public_network_dev='$(subst ",,$(CONFIG_LIBVIRT_SESSION_PUBLIC_NETWORK_DEV))' endif -ifeq (y,$(CONFIG_LIBVIRT_STORAGE_POOL_CREATE)) -GEN_NODES_EXTRA_ARGS += libvirt_storage_pool_create='True' -GEN_NODES_EXTRA_ARGS += libvirt_storage_pool_name='$(subst ",,$(CONFIG_LIBVIRT_STORAGE_POOL_NAME))' -GEN_NODES_EXTRA_ARGS += libvirt_storage_pool_path='$(subst ",,$(CONFIG_KDEVOPS_STORAGE_POOL_PATH))' -endif - GEN_NODES_EXTRA_ARGS += libvirt_extra_storage_aio_mode='$(subst ",,$(CONFIG_LIBVIRT_AIO_MODE))' GEN_NODES_EXTRA_ARGS += libvirt_extra_storage_aio_cache_mode='$(subst ",,$(CONFIG_LIBVIRT_AIO_CACHE_MODE))' diff --git a/scripts/guestfs.Makefile b/scripts/guestfs.Makefile index 8b1b4e9fc7d5..d08e697f3cfb 100644 --- a/scripts/guestfs.Makefile +++ b/scripts/guestfs.Makefile @@ -18,11 +18,6 @@ QEMU_GROUP:=$(subst ",,$(CONFIG_LIBVIRT_QEMU_GROUP)) GUESTFS_ARGS += kdevops_storage_pool_group='$(QEMU_GROUP)' GUESTFS_ARGS += storage_pool_group='$(QEMU_GROUP)' -STORAGE_POOL_PATH:=$(subst ",,$(CONFIG_KDEVOPS_STORAGE_POOL_PATH)) -KDEVOPS_STORAGE_POOL_PATH:=$(STORAGE_POOL_PATH)/kdevops -GUESTFS_ARGS += storage_pool_path=$(STORAGE_POOL_PATH) -GUESTFS_ARGS += kdevops_storage_pool_path=$(KDEVOPS_STORAGE_POOL_PATH) - 9P_HOST_CLONE := ifeq (y,$(CONFIG_BOOTLINUX_9P)) 9P_HOST_CLONE := 9p_linux_clone @@ -109,4 +104,4 @@ destroy_guestfs: PHONY += destroy_guestfs cleancache: - $(Q)rm -f $(subst ",,$(CONFIG_KDEVOPS_STORAGE_POOL_PATH))/kdevops/guestfs/base_images/* + $(Q)rm -f $(subst ",,$(CONFIG_LIBVIRT_STORAGE_POOL_PATH))/kdevops/guestfs/base_images/* diff --git a/scripts/prune_stale_vagrant.sh b/scripts/prune_stale_vagrant.sh index 95b88911c0a6..61ac0e86b6c2 100755 --- a/scripts/prune_stale_vagrant.sh +++ b/scripts/prune_stale_vagrant.sh @@ -37,7 +37,7 @@ if [[ "$CONFIG_LIBVIRT" != "y" ]]; then fi if [[ $# -eq 0 ]]; then - KDEVOPS_POOL_PATH="$CONFIG_KDEVOPS_STORAGE_POOL_PATH" + KDEVOPS_POOL_PATH="$CONFIG_LIBVIRT_STORAGE_POOL_PATH" elif [[ $# -eq 1 ]]; then if [[ "$1" == "--help" ]]; then echo "Usage: $0" diff --git a/scripts/vagrant.Makefile b/scripts/vagrant.Makefile index 368c2f84aa89..664c8f9cfc5c 100644 --- a/scripts/vagrant.Makefile +++ b/scripts/vagrant.Makefile @@ -44,11 +44,6 @@ ifeq (y,$(CONFIG_VAGRANT_VIRTUALBOX)) VAGRANT_ARGS += virtualbox_provider=True endif -STORAGE_POOL_PATH:=$(subst ",,$(CONFIG_KDEVOPS_STORAGE_POOL_PATH)) -KDEVOPS_STORAGE_POOL_PATH:=$(STORAGE_POOL_PATH)/kdevops -VAGRANT_ARGS += storage_pool_path=$(STORAGE_POOL_PATH) -VAGRANT_ARGS += kdevops_storage_pool_path=$(KDEVOPS_STORAGE_POOL_PATH) - VAGRANT_9P_HOST_CLONE := ifeq (y,$(CONFIG_BOOTLINUX_9P)) VAGRANT_9P_HOST_CLONE := vagrant_9p_linux_clone From patchwork Sat Mar 29 23:01:39 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luis Chamberlain X-Patchwork-Id: 14032809 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 0434D1ADC90 for ; Sat, 29 Mar 2025 23:01:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.133 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743289304; cv=none; b=uqPwEdk5CiBKjndeIKCG8bU87WzD6Bu5U0mppwMZop4EGw6ZLLHLB810oq3U4sm7t39jx3DfVY6VV1lYmvtbFpjAApcEjguf0LZUzHSo7zwTnSqYrIoGO4tuN9u54Db2ZUq7Yj/EfUMK9wD4tH2xPFQRCF4eGmqIzyKyt23pZKE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743289304; c=relaxed/simple; bh=lGfFM0XNvLRtOcDPtz9O6nv9uIqBphWTHEPkJen8VYs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=K5/ARIl/vZAvqwbwsr9OaxYXTXbAkPH13fprbmZwJ5DNPOXe5mjtwgkQAc7T8B7/IQVLxFlKrbpTqWwHECF0IXEDK6WP4Kdlf5jF75yqGI5pwegLHny8G5DQgFMWr8HzFeZGymwTkf+7E47lcM0/IudzNQfiQDmeeoOo9C1w79E= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=kernel.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=av7PpZkI; arc=none smtp.client-ip=198.137.202.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="av7PpZkI" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Sender:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description; bh=RPTBWcr9Qzm8svyJLq1vYoBDtYvL9euHh00hnG+MqJE=; b=av7PpZkISDnJHR0nhbApLAYHgC 8ba96GZWTtATigdpUyNWBzsM/1iQPnaCk6yyBLCPeHk3GC8AWdrrViQ1qhbqnbCLY7snkq17mY/Mt 7DbSiWaUPEc4MLIsaa61evu1ueAjO+4K0pJMjcLig1DCbqtm1O4FaqAXUcBqWJYUyahxZVRTYctU9 MCk/gfNeAVkcV0qnAa01cJkLav/CugHorxItYPegH2JQ7Y0HoQwC8L4/vmEqvbWAVRgN/oXF8ij94 Sa4x2CuthmBNIQBOdbNBRGQIKwug8nNtQhCVq8MLMxkKMmJ8o5k3ltJ/+95InbuO/V/mbnUiRUZeQ jmBtMv+g==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.98.1 #2 (Red Hat Linux)) id 1tyfBO-0000000FbIb-1vq9; Sat, 29 Mar 2025 23:01:42 +0000 From: Luis Chamberlain To: kdevops@lists.linux.dev Cc: Luis Chamberlain Subject: [PATCH 4/6] Kconfig: adopt output yaml for KDEVOPS_FIRST_RUN Date: Sat, 29 Mar 2025 16:01:39 -0700 Message-ID: <20250329230141.3718282-5-mcgrof@kernel.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250329230141.3718282-1-mcgrof@kernel.org> References: <20250329230141.3718282-1-mcgrof@kernel.org> Precedence: bulk X-Mailing-List: kdevops@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Sender: Luis Chamberlain This will be used later. Signed-off-by: Luis Chamberlain --- Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/Kconfig b/Kconfig index 357341be108d..988782a9dc83 100644 --- a/Kconfig +++ b/Kconfig @@ -30,6 +30,7 @@ config NEEDS_LOCAL_DEVELOPMENT_PATH config KDEVOPS_FIRST_RUN bool "Is this your first time running kdevops on this system?" + output yaml default n help When you run kdevops for the first time we can enable options From patchwork Sat Mar 29 23:01:40 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luis Chamberlain X-Patchwork-Id: 14032812 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 042198615A for ; Sat, 29 Mar 2025 23:01:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.133 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743289304; cv=none; b=WElBTamBCxNybfT5i/aUae7NW6rg4R7lfIRhkncWih1VuUGlvJWaGwKO+k7RoO95dyJOUndAliuHiZTjAU6V+Nx3AE6TRLvCwX5fOYG+L1Ecpbtq4h5T4TTAvQoM9x/vdBLTU8wfTFAVwDHsQaut6vcbvcVzqDXIHbXEdAVMz5s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743289304; c=relaxed/simple; bh=C8LANLcVTHmYYHW2bNgmBgx/fIzYDvinxYQkIITjJXc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=aUGydL8YfrrwdJk0ttPIAVAb5QZknWPcQsLyfamyVRfYHd4Jna/Hk0lo+/awCxG2W8Ly12LuVaQU5qFMgUtxIysjvOvGECFaSd0alZiUCdyx4cl84DhgDa1hfv7OEbjMHOChTtxYqtCFwL+3NQz8xo+5N8MTfZV1/MhKJBFQVC8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=kernel.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=bSPOP+LH; arc=none smtp.client-ip=198.137.202.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="bSPOP+LH" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Sender:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description; bh=Q+BUDgK0FS2dp+CBBH2PeH+7EaX1UfhFT8tQsgr9Dco=; b=bSPOP+LHI3EDefb9+u/eLJuDKE JOP4hTJI+JlyQfuGtzvk11ecPrHgwFePo3DWk5yP+OBNDrlmcVSLHuXwiw71nwZUuDlbQ/xfXUPCW Jre7IvKORmg8SDJog1JsCmWuWMviA7TR/7cNSMqK8jst+WfC/Zvr6R4AsSy+4dCC5BcZdxplTS5EM bN/zsXRc2S/SPRqQDek12BGO13jmdbXmmO/ZUQSrCDMr3CzOhBskSBNyr5tXiTnrsjWr6++Y5KwnY PyKqPp6g/vLVJhMjl6CWQjCk4yBYRJRIT/sT0TQjjOvTHOz/TAOCrXtUbilbhKXrhqlOxJHsIdTPI L9xTSEEw==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.98.1 #2 (Red Hat Linux)) id 1tyfBO-0000000FbIe-22cw; Sat, 29 Mar 2025 23:01:42 +0000 From: Luis Chamberlain To: kdevops@lists.linux.dev Cc: Luis Chamberlain Subject: [PATCH 5/6] guestfs: replace ansible group permisison requirement on libvirt system uri Date: Sat, 29 Mar 2025 16:01:40 -0700 Message-ID: <20250329230141.3718282-6-mcgrof@kernel.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250329230141.3718282-1-mcgrof@kernel.org> References: <20250329230141.3718282-1-mcgrof@kernel.org> Precedence: bulk X-Mailing-List: kdevops@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Sender: Luis Chamberlain The bringup process for libvirt system URI support (not session), so all debian based distros, requieres us to be paranoid about the permissions of our storage directory where we place our libvirt storage pool, and guestfs images. We used to be stupid and were hammering with a sledge hammer a crazy sudo chown -R on a target storage path. That was removed by commit c31459dc384c ("scripts/bringup_guestfs.sh: fix silly directory permission fix"). I rushed that change in because it was affecting live systems and we needed to get testing moving. This replaces the old requirement with some more less aggressive directory creation and directory permission requirements and adds some sanity checks which don't do the crazy wild permission changes that are possible with a recursive call. Signed-off-by: Luis Chamberlain --- kconfigs/Kconfig.guestfs | 10 +++ .../roles/bringup_guestfs/tasks/main.yml | 76 +++++++++++++++++++ scripts/bringup_guestfs.sh | 3 - scripts/guestfs.Makefile | 2 +- 4 files changed, 87 insertions(+), 4 deletions(-) diff --git a/kconfigs/Kconfig.guestfs b/kconfigs/Kconfig.guestfs index c6d2d1907dd5..d309436fa7c9 100644 --- a/kconfigs/Kconfig.guestfs +++ b/kconfigs/Kconfig.guestfs @@ -5,6 +5,16 @@ config STORAGE_POOL_PATH output yaml default LIBVIRT_STORAGE_POOL_PATH +config GUESTFS_STORAGE_DIR + string + output yaml + default "{{ kdevops_storage_pool_path }}/kdevops/guestfs" + +config GUESTFS_BASE_IMAGE_DIR + string + output yaml + default "{{ guestfs_storage_dir }}/base_images" + config GUESTFS_HAS_CUSTOM_RAW_IMAGE bool diff --git a/playbooks/roles/bringup_guestfs/tasks/main.yml b/playbooks/roles/bringup_guestfs/tasks/main.yml index dcbbaef02522..0b193dad807f 100644 --- a/playbooks/roles/bringup_guestfs/tasks/main.yml +++ b/playbooks/roles/bringup_guestfs/tasks/main.yml @@ -42,6 +42,82 @@ when: guestfs_subdirectories.matched == 0 tags: [ 'config-check' ] +- name: Create storage pool path directory if (libvirt session uri) + file: + path: "{{ libvirt_storage_pool_path }}" + state: directory + when: 'not libvirt_uri_system|bool' + tags: ['storage-pool-path'] + +- name: Create storage pool path directory and set group if using (libvirt system uri) + file: + path: "{{ libvirt_storage_pool_path }}" + state: directory + owner: root + group: "{{ libvirt_qemu_group }}" + mode: "0775" + when: 'libvirt_uri_system|bool' + tags: ['storage-pool-path'] + +- name: Create kdevops guestfs storage directory if missing (libvirt session uri) + file: + path: "{{ guestfs_base_image_dir }}" + state: directory + mode: '0755' + tags: ['storage-pool-path'] + when: + - 'not libvirt_uri_system|bool' + +- name: Create kdevops guestfs storage directory if missing (libvirt system uri) + become: yes + become_flags: 'su - -c' + become_method: sudo + file: + path: "{{ guestfs_base_image_dir }}" + state: directory + mode: '0775' + group: "{{ libvirt_qemu_group }}" + tags: ['storage-pool-path'] + when: + - 'libvirt_uri_system|bool' + +- name: Check if directory is owned by the correct group (libvirt system uri) + become: yes + become_flags: 'su - -c' + become_method: sudo + command: stat -c '%G' "{{ libvirt_storage_pool_path }}" + register: dir_group + changed_when: false + tags: ['storage-pool-path'] + when: + - 'libvirt_uri_system|bool' + +- name: Check if directory has group write permissions (libvirt system uri) + become: yes + become_flags: 'su - -c' + become_method: sudo + command: stat -c '%A' "{{ libvirt_storage_pool_path }}" + register: dir_perms + changed_when: false + tags: ['storage-pool-path'] + when: + - 'libvirt_uri_system|bool' + +- name: Verify storage pool path directory is group-writable (libvirt system uri) + become: yes + become_flags: 'su - -c' + become_method: sudo + fail: + msg: | + The permissions for {{ libvirt_storage_pool_path }} should be group + writeable by the group used by libvirt: {{ libvirt_qemu_group }} + Current group: {{ dir_group.stdout }} + Current permissions: {{ dir_perms.stdout }} + tags: ['storage-pool-path'] + when: + - 'libvirt_uri_system|bool' + - (dir_group.stdout != libvirt_qemu_group) or (dir_perms.stdout[5] != 'w') + - name: Check for dnsmasq configuration files stat: path: "{{ item }}" diff --git a/scripts/bringup_guestfs.sh b/scripts/bringup_guestfs.sh index 976d1e78ed6a..bc0176f8f5b4 100755 --- a/scripts/bringup_guestfs.sh +++ b/scripts/bringup_guestfs.sh @@ -271,9 +271,6 @@ if [[ "$CONFIG_LIBVIRT_URI_SYSTEM" == "y" ]]; then USE_SUDO="sudo " fi -$USE_SUDO mkdir -p $STORAGEDIR -$USE_SUDO mkdir -p $BASE_IMAGE_DIR - cmdfile=$(mktemp) if [ ! -f $BASE_IMAGE ]; then diff --git a/scripts/guestfs.Makefile b/scripts/guestfs.Makefile index d08e697f3cfb..e1cf25d62d04 100644 --- a/scripts/guestfs.Makefile +++ b/scripts/guestfs.Makefile @@ -83,7 +83,7 @@ bringup_guestfs: $(GUESTFS_BRINGUP_DEPS) playbooks/bringup_guestfs.yml \ -e 'ansible_python_interpreter=/usr/bin/python3' \ --extra-vars=@./extra_vars.yaml \ - --tags config-check,network + --tags config-check,network,storage-pool-path $(Q)$(TOPDIR)/scripts/bringup_guestfs.sh $(Q)ansible-playbook $(ANSIBLE_VERBOSE) --connection=local \ --inventory localhost, \ From patchwork Sat Mar 29 23:01:41 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luis Chamberlain X-Patchwork-Id: 14032810 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 043081ADC8D for ; Sat, 29 Mar 2025 23:01:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.133 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743289304; cv=none; b=l2PLArloHkM4a5cXho+qSGl80fVPmK62pAxb3GDItCHFPcT07HjDmiTvv8jh+mpnuuAPVTvrm1wxM17zOdeAtJAR5/BPJM8umfOhS2FVUA4+6nXzjdnsz+NgrGR7PMTbBoxNDYcINHrf5qP3mWu0+YeGQGkRd5J01Uc0j4m5qSQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743289304; c=relaxed/simple; bh=DTMptcFU7ayKP5dNUTe/phyvBNsHAS8IUoEC29Oe0lM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=sAq8391+r6b5SpJpbVdpR9FhyXygzeEFUykZyBX4r1NGwu0lMbINiYc9yWXyiRHUDH+OlK6JdC1gHXpzhDtuR0NR5G26uT0GuUiBSx8GpM6ZjyBGNCk5NLYqKpjjVYXUy3t9PePonnMd4NT5BvAAwicaXf5MU0j4bF8pR9607UA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=kernel.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=pLv3K/vW; arc=none smtp.client-ip=198.137.202.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="pLv3K/vW" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Sender:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description; bh=ciN0I8aTFtrlfHS74JZrGIkA6a2PuUD4BtCZ/Te0zok=; b=pLv3K/vWkuEN+jd+kDpd2jks65 xW63omERy2Pz/n9vViiuNg196kMXd5oEqKz5FTGvVIWn03YkkTiumxNuAmLfrpUTa+Zgq5Grb828n EOw0J3juFtyqcplAeeUPjW6XoDkr21Yt1DcdG9IMq15JtaaFJchM9+BGgg2lDKo3xJ4JFKOnoLstt NU78LML33RVrB7yLauU0mTvFiXG8heBrJf+YIYUNfJr1gX+Hrm/o/WyBiQoyNX1hhbe2kxRlaolmB E0tmBhGQmdfLeVXQMY8GiBtCO9IlELf8RrnmIeppximpUzKd0+AfMRoBPYOoXMyYl18G4fmZ/Sx+B wXNhoB4g==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.98.1 #2 (Red Hat Linux)) id 1tyfBO-0000000FbIg-29HO; Sat, 29 Mar 2025 23:01:42 +0000 From: Luis Chamberlain To: kdevops@lists.linux.dev Cc: Luis Chamberlain Subject: [PATCH 6/6] gen_nodes: ensure kdevops prefix has no dashes Date: Sat, 29 Mar 2025 16:01:41 -0700 Message-ID: <20250329230141.3718282-7-mcgrof@kernel.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250329230141.3718282-1-mcgrof@kernel.org> References: <20250329230141.3718282-1-mcgrof@kernel.org> Precedence: bulk X-Mailing-List: kdevops@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Sender: Luis Chamberlain Folks trying to use kdevops and testing with fstests will quickly find out a surprise that their config is not being parsed correctly until later. Fix this by preventing bringup if the prefix has a dash. We use the dash to help parallelize testing filesystem profiles and so the host prefix goes before the filesystem name and test profile. Signed-off-by: Luis Chamberlain Reported-by: Scott Mayhew Signed-off-by: Luis Chamberlain --- playbooks/roles/gen_nodes/tasks/main.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/playbooks/roles/gen_nodes/tasks/main.yml b/playbooks/roles/gen_nodes/tasks/main.yml index d541dcbf1f54..8c6a1f705ee2 100644 --- a/playbooks/roles/gen_nodes/tasks/main.yml +++ b/playbooks/roles/gen_nodes/tasks/main.yml @@ -18,6 +18,11 @@ command: "id -g -n" register: my_group +- name: Fail if kdevops_host_prefix contains a dash + fail: + msg: "Invalid kdevops_host_prefix '{{ kdevops_host_prefix }}'. The prefix cannot contain a dash ('-')." + when: kdevops_host_prefix is search("-") + - name: Create guestfs directory ansible.builtin.file: path: "{{ guestfs_path }}"