From patchwork Wed Dec 18 10:29:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Granados X-Patchwork-Id: 13913374 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 E25A61F37A0 for ; Wed, 18 Dec 2024 10:30:12 +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=1734517813; cv=none; b=bd15vRXljLMzXTRkCjRQXBg2189VM7/APhxZihWbHJp5OfER0rm83gMWJAS6vPXTu9tMRDP8zgOWM0Vg1AZRFXzupnQyf+KL2KWpx/1V8UHdE+DZW0nkphg+OIX9BtO3N5JDwalqnDluYEOhNM/pKvj3rs7Pf1rnUlXQXeNCrSc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734517813; c=relaxed/simple; bh=Kj8tG89mwj8PU4V97afgamZ3sTf5UN0mvrsoVFXiIVg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=SyAfU+w05IoAnvEFGUdenhJ4essppiB4a514Tng23IZNnLyJbx8iCOn5F0cCbwHu1q0vkY8hFriahhdDTH5Hz6gBPNLWkXmS4PHvPcY99H4hji7UCsIKDGPyCG+2XiJ+0Qhl+wJkPxh3fzKmWF/yde+NFC9WbMmVutpWGaPTdOQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=qMCux50i; 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="qMCux50i" Received: by smtp.kernel.org (Postfix) with ESMTPS id 5AFFAC4CEE3; Wed, 18 Dec 2024 10:30:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1734517812; bh=Kj8tG89mwj8PU4V97afgamZ3sTf5UN0mvrsoVFXiIVg=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=qMCux50iYvZEMyLaMPSfWPTZt7nV60EN9wxnCWY+QLptVBu4A68POSrmPhHlYWlNQ hbvWqytxin75dGvNhSXjKzDU+pDd/mphYTjNImleav2efV+cC0pxTujg0f55IXrXG4 5EsZNuSWVV21nXO+CAe2lDkZqhs2/LKEUiQi8N3QlHQynIAdYgd4G19JetEuERg6Rw XU4mkcNDaScgEjXyIOp0MGadd80D+kaDIO8jZnx48k2RLY67VzvElCfZmwHpNbbJKC Yo8CDDDRTeVD8P9N7B06uleeJns9z+y0uQL+EBrs7yLGtnYf2IQ5xmZlV45egTCFhe 0cXKueqh2Azww== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 51ECCE77187; Wed, 18 Dec 2024 10:30:12 +0000 (UTC) From: Joel Granados Date: Wed, 18 Dec 2024 11:29:59 +0100 Subject: [PATCH 05/12] ansible: Add build-deps tag Precedence: bulk X-Mailing-List: kdevops@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241218-jag-bringup_fixes-v1-5-0bf2e07c640c@kernel.org> References: <20241218-jag-bringup_fixes-v1-0-0bf2e07c640c@kernel.org> In-Reply-To: <20241218-jag-bringup_fixes-v1-0-0bf2e07c640c@kernel.org> To: kdevops@lists.linux.dev Cc: Joel Granados , da.gomez@samsung.com X-Mailer: b4 0.15-dev-00a43 X-Developer-Signature: v=1; a=openpgp-sha256; l=4391; i=joel.granados@kernel.org; h=from:subject:message-id; bh=Kj8tG89mwj8PU4V97afgamZ3sTf5UN0mvrsoVFXiIVg=; b=owJ4nAHtARL+kA0DAAoBupfNUreWQU8ByyZiAGdipC0vTFCqIVpjdbbPEJRIefkKcGeOQGTqs 61CixbFj4kqXIkBswQAAQoAHRYhBK5HCVcl5jElzssnkLqXzVK3lkFPBQJnYqQtAAoJELqXzVK3 lkFPwH4L/0FJwTP7TFAJz8mSk4qBqmp1g7Mmay+nn3Ara86b/yUJrDr2Gz5bvMHV6IIi9ZqdFfF EUtLKFOIk4Exk8Bn9gEQnPftUy/txE7jeknm0/0BgvQ3HZ2ALO33MMnCGSNMBH04GpRCU8UMRAD rLOuFKvbEMRHTiqlmC6TrP9It+pfQy1v1skPDunDTYTIVSgUCzVi2YH2wdkKXKyH0Zct3ZGdvge o7OU78seX+J+mBoQWmxs4bsM5Xgmelcdv7st/F/sU5F1qZwoAmx5VRRO4qMPRemUjKCeWhCOHim 99mcCCefghqQeLTzBpx3t8Z4r9pAa3bjc4upi81ZHwXZ8izOUYRcZtlc/QiCRVDSecPy0hcXhc2 pcSCGHWnIkIKbQx+RUa9nqLH/D9NOX5l6z+PdTL0kGWG8JCVRNcQA9fOVmu6rAu5oK0qd2+RONx VpyxzmS6u4GUp19PnE+7PsSYG47NFxZOBERymXr44ALgUVq50yRS0fWUD1xs6xovzg7+xXa0037 xw= X-Developer-Key: i=joel.granados@kernel.org; a=openpgp; fpr=F1F8E46D30F0F6C4A45FF4465895FAAC338C6E77 X-Endpoint-Received: by B4 Relay for joel.granados@kernel.org/default with auth_id=239 Add build-deps tag to enable-user and install-deps tasks in libvirt_user role so they can be used from other roles. With no tags, these tasks are skipped. Signed-off-by: Joel Granados --- playbooks/roles/libvirt_user/tasks/enable-user/debian/main.yml | 6 +++++- playbooks/roles/libvirt_user/tasks/enable-user/main.yml | 4 ++++ playbooks/roles/libvirt_user/tasks/install-deps/main.yml | 7 +++++++ scripts/guestfs.Makefile | 2 +- 4 files changed, 17 insertions(+), 2 deletions(-) diff --git a/playbooks/roles/libvirt_user/tasks/enable-user/debian/main.yml b/playbooks/roles/libvirt_user/tasks/enable-user/debian/main.yml index 1ad7f17..5797bd6 100644 --- a/playbooks/roles/libvirt_user/tasks/enable-user/debian/main.yml +++ b/playbooks/roles/libvirt_user/tasks/enable-user/debian/main.yml @@ -9,12 +9,14 @@ when: - not libvirt_session - not only_verify_user|bool + tags: [ 'build-deps' ] - name: Check if apparmor_status exists stat: path: /usr/sbin/apparmor_status register: apparmor_file_stat_result when: 'only_verify_user|bool' + tags: [ 'build-deps' ] - name: Verify if AppArmor is disabled when applicable become: yes @@ -26,6 +28,7 @@ when: - 'only_verify_user|bool' - 'apparmor_file_stat_result.stat.exists' + tags: [ 'build-deps' ] - name: Verifies user's effective group allows to run libvirt/kvm without being root shell: groups | grep {{ item }} @@ -41,9 +44,10 @@ when: - not libvirt_session - not only_verify_user|bool + tags: [ 'build-deps' ] - name: Ensure our user is part of the libvirt/kvm groups - tags: [ 'journal' ] + tags: [ 'journal', 'build-deps' ] become: yes become_flags: 'su - -c' become_method: sudo diff --git a/playbooks/roles/libvirt_user/tasks/enable-user/main.yml b/playbooks/roles/libvirt_user/tasks/enable-user/main.yml index 04f8e31..364d625 100644 --- a/playbooks/roles/libvirt_user/tasks/enable-user/main.yml +++ b/playbooks/roles/libvirt_user/tasks/enable-user/main.yml @@ -2,19 +2,23 @@ - name: Debian-specific set up ansible.builtin.include_tasks: install-deps/debian/main.yml when: ansible_os_family == 'Debian' + tags: [ 'build-deps' ] - name: SuSE-specific set up ansible.builtin.include_tasks: install-deps/suse/main.yml when: ansible_os_family == 'Suse' + tags: [ 'build-deps' ] - name: Red Hat-specific set up ansible.builtin.include_tasks: install-deps/redhat/main.yml when: - ansible_os_family == 'RedHat' - ansible_facts['distribution'] != "Fedora" + tags: [ 'build-deps' ] - name: Fedora-specific set up ansible.builtin.include_tasks: install-deps/fedora/main.yml when: - ansible_os_family == 'RedHat' - ansible_facts['distribution'] == "Fedora" + tags: [ 'build-deps' ] diff --git a/playbooks/roles/libvirt_user/tasks/install-deps/main.yml b/playbooks/roles/libvirt_user/tasks/install-deps/main.yml index c652ab2..c2f58c8 100644 --- a/playbooks/roles/libvirt_user/tasks/install-deps/main.yml +++ b/playbooks/roles/libvirt_user/tasks/install-deps/main.yml @@ -11,11 +11,18 @@ - name: Distribution specific setup import_tasks: debian/main.yml when: ansible_facts['os_family']|lower == 'debian' + tags: [ 'build-deps' ] + - import_tasks: suse/main.yml when: ansible_facts['os_family']|lower == 'suse' + tags: [ 'build-deps' ] + - import_tasks: redhat/main.yml when: - ansible_facts['os_family']|lower == 'redhat' - ansible_facts['distribution']|lower != "fedora" + tags: [ 'build-deps' ] + - import_tasks: fedora/main.yml when: ansible_facts['distribution']|lower == "fedora" + tags: [ 'build-deps' ] diff --git a/scripts/guestfs.Makefile b/scripts/guestfs.Makefile index 52397d5..dbfb372 100644 --- a/scripts/guestfs.Makefile +++ b/scripts/guestfs.Makefile @@ -78,7 +78,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,build-deps $(Q)$(TOPDIR)/scripts/bringup_guestfs.sh $(Q)ansible-playbook $(ANSIBLE_VERBOSE) --connection=local \ --inventory localhost, \