From mboxrd@z Thu Jan 1 00:00:00 1970 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 1FA30277026 for ; Fri, 30 May 2025 17:52:38 +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=1748627558; cv=none; b=Jv+WjX9eRijRcRcgiXEaQegEAdXOF6BBRagS++aCpyRxQ4hIMF+NN07xMVX7anfwrRDL6J3KNWcFVvtb27BTn2Cx+sLERIhpU12JhYpqcA+dAdBp1I3OD/h4m59QeYT8//94RphWXgUVQN4+apxRFzHQa04CsC2tOAsE+k6I5tM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748627558; c=relaxed/simple; bh=6iHCHnIfi8/bb4UU2FwKJ84uu++MaD5R6rRlomziaNM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=bCFQhf/Puj+MZOwrHLgD0bjrhc6z6nw7x2Mar9ERMvUOnPQWR2b8hKTagUNUje+TnaWHrXT6sW/sAqll7VNJjYRTbbK/1HBKpMOkSE4dv9/UiZMxCO4/Ckh0AfUL+ypg5RN0cQd3c9AM1bB2sAJ/nEUkR6sPxX2uPZ/uHdSFKRI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=WTECSPNZ; 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="WTECSPNZ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B3A95C4CEF1; Fri, 30 May 2025 17:52:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1748627558; bh=6iHCHnIfi8/bb4UU2FwKJ84uu++MaD5R6rRlomziaNM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WTECSPNZI42fkm7SqVjQr6tApZ/7DY5W3mAcUFrzDg7pcYg84M0lYT1kTmYLarXTr JkseSdbGuiNEk5svLZfFF+2RFkJJmX88w6Ky5LFRBk0oWQ2PTmhZ9zXiFMbLu+65Bw rE5FlWhjLsL11bYEpN1JfrOG0G0WLFIokLOp2Z1Gf1/G6trdObo84R6Cf55xnzM1Tm TN87fes8ATC86oPuYPRC8Qj7yN5WNTrLJt4YbSJ5VGx/YjsqYIaJW98MmAs/5JFiuY x3uLvZ4S5uqgSnVJfW/ezgsPtl9TtcViOB1VyCLI3WshRni3GVNbzgkc1UvrEeVHBJ FsqCtbB3OUo+Q== From: Chuck Lever To: Cc: Chuck Lever Subject: [PATCH v2 10/12] bringup_guestfs: Remove the role Date: Fri, 30 May 2025 13:52:27 -0400 Message-ID: <20250530175229.489925-11-cel@kernel.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250530175229.489925-1-cel@kernel.org> References: <20250530175229.489925-1-cel@kernel.org> Precedence: bulk X-Mailing-List: kdevops@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Chuck Lever Clean up: The tasks performed by the bringup_guestfs role have been superceded by the new guestfs role. Signed-off-by: Chuck Lever --- playbooks/bringup_guestfs.yml | 4 - .../roles/bringup_guestfs/defaults/main.yml | 12 - .../tasks/install-deps/debian/main.yml | 11 - .../tasks/install-deps/main.yml | 17 -- .../tasks/install-deps/redhat/main.yml | 11 - .../tasks/install-deps/suse/main.yml | 10 - .../roles/bringup_guestfs/tasks/main.yml | 243 ------------------ 7 files changed, 308 deletions(-) delete mode 100644 playbooks/bringup_guestfs.yml delete mode 100644 playbooks/roles/bringup_guestfs/defaults/main.yml delete mode 100644 playbooks/roles/bringup_guestfs/tasks/install-deps/debian/main.yml delete mode 100644 playbooks/roles/bringup_guestfs/tasks/install-deps/main.yml delete mode 100644 playbooks/roles/bringup_guestfs/tasks/install-deps/redhat/main.yml delete mode 100644 playbooks/roles/bringup_guestfs/tasks/install-deps/suse/main.yml delete mode 100644 playbooks/roles/bringup_guestfs/tasks/main.yml diff --git a/playbooks/bringup_guestfs.yml b/playbooks/bringup_guestfs.yml deleted file mode 100644 index 80a1afcd0a69..000000000000 --- a/playbooks/bringup_guestfs.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -- hosts: localhost - roles: - - role: bringup_guestfs diff --git a/playbooks/roles/bringup_guestfs/defaults/main.yml b/playbooks/roles/bringup_guestfs/defaults/main.yml deleted file mode 100644 index 65867cd1093a..000000000000 --- a/playbooks/roles/bringup_guestfs/defaults/main.yml +++ /dev/null @@ -1,12 +0,0 @@ -# SPDX-License-Identifier GPL-2.0+ ---- -libvirt_uri_system: False -distro_debian: False -distro_debian_based: False -distro_redhat: False -distro_redhat_based: False -distro_fedora: False -distro_suse: False -distro_suse_based: False -distro_ubuntu: False -dnsmasq_files_exist: False diff --git a/playbooks/roles/bringup_guestfs/tasks/install-deps/debian/main.yml b/playbooks/roles/bringup_guestfs/tasks/install-deps/debian/main.yml deleted file mode 100644 index 6b502f59f3e4..000000000000 --- a/playbooks/roles/bringup_guestfs/tasks/install-deps/debian/main.yml +++ /dev/null @@ -1,11 +0,0 @@ ---- -- name: Install libguestfs - become: true - become_method: ansible.builtin.sudo - ansible.builtin.package: - update_cache: true - name: - - libguestfs-tools - - isc-dhcp-client - state: present - tags: ['install-deps'] diff --git a/playbooks/roles/bringup_guestfs/tasks/install-deps/main.yml b/playbooks/roles/bringup_guestfs/tasks/install-deps/main.yml deleted file mode 100644 index af3be6dea3c3..000000000000 --- a/playbooks/roles/bringup_guestfs/tasks/install-deps/main.yml +++ /dev/null @@ -1,17 +0,0 @@ ---- -- name: Debian-specific setup - ansible.builtin.include_tasks: debian/main.yml - when: ansible_facts['os_family']|lower == 'debian' - tags: ['install-deps'] - -- name: SuSE-specific setup - ansible.builtin.include_tasks: suse/main.yml - when: ansible_facts['os_family']|lower == 'suse' - tags: ['install-deps'] - -- name: Fedora/Red Hat Enterprise-specific setup - ansible.builtin.include_tasks: redhat/main.yml - when: - - ansible_facts['os_family']|lower == 'redhat' - - ansible_facts['distribution']|lower != "fedora" - tags: ['install-deps'] diff --git a/playbooks/roles/bringup_guestfs/tasks/install-deps/redhat/main.yml b/playbooks/roles/bringup_guestfs/tasks/install-deps/redhat/main.yml deleted file mode 100644 index 5e4bfa9c9aeb..000000000000 --- a/playbooks/roles/bringup_guestfs/tasks/install-deps/redhat/main.yml +++ /dev/null @@ -1,11 +0,0 @@ ---- -- name: Install libguestfs on Fedora/RedHat - become: true - become_method: ansible.builtin.sudo - ansible.builtin.package: - update_cache: true - name: - - libguestfs-tools - - dhcpcd - state: present - tags: ['install-deps'] diff --git a/playbooks/roles/bringup_guestfs/tasks/install-deps/suse/main.yml b/playbooks/roles/bringup_guestfs/tasks/install-deps/suse/main.yml deleted file mode 100644 index 730bc20b5a7b..000000000000 --- a/playbooks/roles/bringup_guestfs/tasks/install-deps/suse/main.yml +++ /dev/null @@ -1,10 +0,0 @@ ---- -- name: Install libguestfs on SUSE - become: true - become_method: ansible.builtin.sudo - ansible.builtin.package: - name: - - libguestfs-tools - - dhcpcd - state: present - tags: ['install-deps'] diff --git a/playbooks/roles/bringup_guestfs/tasks/main.yml b/playbooks/roles/bringup_guestfs/tasks/main.yml deleted file mode 100644 index 3c4e61a7a095..000000000000 --- a/playbooks/roles/bringup_guestfs/tasks/main.yml +++ /dev/null @@ -1,243 +0,0 @@ -- name: Install dependencies - ansible.builtin.include_tasks: install-deps/main.yml - tags: ['install-deps'] - -- name: Verify we're configured {{ topdir_path }}/.config directory exists - stat: - path: "{{ topdir_path }}/.config" - register: config_file - tags: [ 'config-check' ] - -- name: Fail if {{ topdir_path }}/.config is not present - fail: - msg: "kdevops is not confgured. You must run 'make menuconfig'" - when: not config_file.stat.exists or not config_file.stat.isreg - tags: [ 'config-check' ] - -- name: Check if guestfs directory exists - stat: - path: "{{ topdir_path }}/guestfs" - register: guestfs_dir_stat - tags: [ 'config-check' ] - -- name: Fail if guestfs directory does not exist - fail: - msg: "The guestfs directory does not exist. You must run make first." - when: not guestfs_dir_stat.stat.exists - tags: [ 'config-check' ] - -- name: Check for directories in {{ topdir_path }}/guestfs - find: - paths: "{{ topdir_path }}/guestfs" - file_type: directory - recurse: no - depth: 1 - register: guestfs_subdirectories - when: guestfs_dir_stat.stat.exists - tags: [ 'config-check' ] - -- name: Fail if no directories found in {{ topdir_path }}/guestfs - fail: - msg: "No directories found in guestfs. You must run make first." - 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) - become: yes - become_flags: 'su - -c' - become_method: sudo - 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 }}" - loop: - - /etc/dnsmasq.conf - - /etc/dnsmasq.d - register: dnsmasq_config_files - when: - - distro_debian_based|bool - tags: [ 'network' ] - -- name: Fail if dnsmasq configuration files exist - fail: - msg: | - dnsmasq configuration files or directories still exist. - Please remove the following to fully uninstall - dnsmasq:\n{{ dnsmasq_config_files | join('\n') }} - when: - - distro_debian_based|bool - - dnsmasq_config_files.results | selectattr('stat.exists') | list | length > 0 - tags: [ 'network' ] - -- name: Check dnsmasq service status - become: yes - become_flags: 'su - -c' - become_method: sudo - command: systemctl is-enabled dnsmasq - register: dnsmasq_enabled - failed_when: false - changed_when: false - when: - - distro_debian_based|bool - - dnsmasq_config_files | length > 0 - tags: [ 'network' ] - -- name: Check if dnsmasq service is active - become: yes - become_flags: 'su - -c' - become_method: sudo - command: systemctl is-active dnsmasq - register: dnsmasq_active - failed_when: false - changed_when: false - when: - - distro_debian_based|bool - - dnsmasq_config_files | length > 0 - tags: [ 'network' ] - -- name: Fail if dnsmasq service is enabled or active - fail: - msg: | - dnsmasq service is - {{ 'enabled' if dnsmasq_enabled.rc == 0 else 'active' if dnsmasq_active.rc == 0 else 'present' }}. - Please ensure dnsmasq is fully uninstalled and disabled. - Run 'sudo systemctl disable dnsmasq' and 'sudo systemctl - stop dnsmasq' to disable and stop the service. - when: - - distro_debian_based|bool - - dnsmasq_config_files | length > 0 - - (dnsmasq_enabled.rc == 0) or (dnsmasq_active.rc == 0) - tags: [ 'network' ] - -- name: Check if libvirt default network is running - become: yes - become_flags: 'su - -c' - become_method: sudo - shell: virsh net-list | grep -q default - register: libvirt_default_net - ignore_errors: yes - when: - - 'libvirt_uri_system|bool' - tags: [ 'network' ] - -- name: Start the libvirt default network if not running - command: virsh net-start default - become: yes - become_flags: 'su - -c' - become_method: sudo - when: - - 'libvirt_uri_system|bool' - - libvirt_default_net.rc != 0 - tags: [ 'network' ] - -- name: Get the actual user who invoked Ansible - command: whoami - register: reg_user - changed_when: false - when: - - 'libvirt_uri_system|bool' - tags: ['console-permissions'] - -- name: Look for console.log files in guestfs subdirectories to check for CI enablement - become: yes - become_flags: 'su - -c' - become_method: sudo - find: - paths: "{{ topdir_path }}/guestfs" - patterns: "console.log" - file_type: file - recurse: yes - register: console_log_files - when: - - 'libvirt_uri_system|bool' - tags: ['console-permissions'] - -- name: Ensure console.log files are owned by the main user for CI monitoring - become: yes - become_flags: 'su - -c' - become_method: sudo - file: - path: "{{ item.path }}" - owner: "{{ reg_user.stdout }}" - group: "{{ reg_user.stdout }}" - loop: "{{ console_log_files.files }}" - loop_control: - label: "{{ item.path | regex_replace('^.*guestfs/', 'guestfs/') }}" - when: - - 'libvirt_uri_system|bool' - - console_log_files.matched > 0 - tags: ['console-permissions'] -- 2.49.0