From patchwork Mon Jan 13 11:53:03 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Granados X-Patchwork-Id: 13937224 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 E387E1CAA9B for ; Mon, 13 Jan 2025 11:53:15 +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=1736769196; cv=none; b=tjU659qpW+ryR5K3VvmgL8fmPhnOQ1E39XyUQdFsfKGC3EkCkY46qhHjDj2DFAGmFHERajCQbaikhYxvi7w0GqVtV/UxGptEx4wVTA09/c+OMRqD91ZMWIlOoUKgw9/gjhDyYfFe6fagEIdYa8wJbh1M9dc2bjPg5mCqGymkwTY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736769196; c=relaxed/simple; bh=Kj8tG89mwj8PU4V97afgamZ3sTf5UN0mvrsoVFXiIVg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ZYSEffI4qEwqL9HaTCpLPp1lN9eHOiQgXIWkvyx0S/T0PjaL4nXCMlQIwziWwkkJk46Y135o71oQ+bNKqYBf3JMtCBX6Fh+EGtLrCgYx5k0bqqQNMXHvSv5X3DGMGWm3Sql+l3yhNoA6ttJxUFbQwyS2fjghYS1hV3nWtfHjteY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=u7jM6x9a; 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="u7jM6x9a" Received: by smtp.kernel.org (Postfix) with ESMTPS id B47E5C4CEE7; Mon, 13 Jan 2025 11:53:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1736769195; bh=Kj8tG89mwj8PU4V97afgamZ3sTf5UN0mvrsoVFXiIVg=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=u7jM6x9awc6Nf7CKSRNgBbA+yXV2afu+Ko2m8hGeK0bi0wHvdekvnFOv3aNTHJjGj QgUyc3+o0eSKcQotHsdavGYVI7pEnLGl0Y9TTZNh4LYyBMrGSwoPPNqkjgxtSdGJcr rr+Dbu3lhiQ7hYT6hhxRjR01FegRzHq8Nlu35kPkLyX9+6xFw0fJS2ebw9J6t9fofV Hk5HmQd9+Uu4RsrcAC4hsyo5e92oyRire8El3xwG/rvu1Lk+maF6fXc2GUeICwYSIz 4zOin+q4FRbNAy6bSQn/89UWyk9Ao/z9EMEPvuZeMQPRa7YyQiIP0PBk8iV/LXsz7l VpXpH+NI1v7AQ== 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 A83BFE7719F; Mon, 13 Jan 2025 11:53:15 +0000 (UTC) From: Joel Granados Date: Mon, 13 Jan 2025 12:53:03 +0100 Subject: [PATCH RESEND 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: <20250113-jag-bringup_fixes-v1-5-fb28030b1f26@kernel.org> References: <20250113-jag-bringup_fixes-v1-0-fb28030b1f26@kernel.org> In-Reply-To: <20250113-jag-bringup_fixes-v1-0-fb28030b1f26@kernel.org> To: kdevops@lists.linux.dev Cc: Joel Granados , mcgrof@kernel.org, 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+kA0DAAoBupfNUreWQU8ByyZiAGeE/qTXNiUlGhdzLy5vPbCMHEDNSguT3LtWO GyobgsF2spZEYkBswQAAQoAHRYhBK5HCVcl5jElzssnkLqXzVK3lkFPBQJnhP6kAAoJELqXzVK3 lkFPZIEL/1rWjKeAiyg6DTVOur54N4hHhEs+7inxL28ZA/u3LEFTS3imMEr+XP+G5PEUdOcwTiy CzO/XRsUoCF17qJsj3Jw/I69sOmDAceS9hY0SWIJtTWWolnMb8vxVP3VyoWUaesQ1j79M9hroCt JXL/nYzDpHjtUwmlV+dUd+yO452Wm7P43EZfmXjYnu8YZcOBG38TtfDB+uCQpESVkEbaFmy5exY JshdmhdwzMLD4M8pxo/KyI2FUZcSk86MPvdlKNGYollzIb6URcK0igvCRyAxP6kU/ylu4xqogi3 nZzGT4Y3aRWZoEn2lzMXju52VE/UW8ULaZ7ILbm/itYXcvWeGnWat8BoA/Jh8LHMW57iHlkqefh kGD/vcuk8EAdc2WwPMuR8oqO8oZVTuC3IO6Jiz1yDSSuWJR49evMUGFhXj6oSi6jlmkCjwaE9Qr 80Mv9A6mphU3iwJdhRoE4Yac4J/6kBoMjc2X57pS+Bn1TutxIHSzXCPVbt8v1alI3sT9QMFloV4 Ck= 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, \