public inbox for kdevops@lists.linux.dev
 help / color / mirror / Atom feed
From: Chuck Lever <cel@kernel.org>
To: <kdevops@lists.linux.dev>
Cc: Chuck Lever <chuck.lever@oracle.com>
Subject: [PATCH v2 10/12] bringup_guestfs: Remove the role
Date: Fri, 30 May 2025 13:52:27 -0400	[thread overview]
Message-ID: <20250530175229.489925-11-cel@kernel.org> (raw)
In-Reply-To: <20250530175229.489925-1-cel@kernel.org>

From: Chuck Lever <chuck.lever@oracle.com>

Clean up: The tasks performed by the bringup_guestfs role have been
superceded by the new guestfs role.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
 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


  parent reply	other threads:[~2025-05-30 17:52 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-30 17:52 [PATCH v2 00/12] Convert bringup_guestfs to a single Ansible role Chuck Lever
2025-05-30 17:52 ` [PATCH v2 01/12] guestfs: Replace scripts/destroy_guestfs.sh with an Ansible playbook Chuck Lever
2025-05-30 17:52 ` [PATCH v2 02/12] Move the guestfs install-deps to the guestfs playbook Chuck Lever
2025-05-30 17:52 ` [PATCH v2 03/12] guestfs: Do not use the config-check tag Chuck Lever
2025-05-30 17:52 ` [PATCH v2 04/12] guestfs: Add a "bringup" tag to the guestfs role Chuck Lever
2025-05-30 17:52 ` [PATCH v2 05/12] guestfs: Copy "network" tag steps to " Chuck Lever
2025-05-30 17:52 ` [PATCH v2 06/12] guestfs: Move the QEMU_GROUP check Chuck Lever
2025-05-30 17:52 ` [PATCH v2 07/12] Add a base-image role Chuck Lever
2025-05-30 17:52 ` [PATCH v2 08/12] guestfs: Convert scripts/bringup_guestfs.sh to Ansible Chuck Lever
2025-05-30 17:52 ` [PATCH v2 09/12] guestfs: Move console-related steps to guestfs role Chuck Lever
2025-05-30 17:52 ` Chuck Lever [this message]
2025-05-30 17:52 ` [PATCH v2 11/12] scripts: Remove the bringup_guestfs.sh script Chuck Lever
2025-05-30 17:52 ` [PATCH v2 12/12] scripts: Remove the destroy_guestfs.sh script Chuck Lever
2025-06-03 19:29 ` [PATCH v2 00/12] Convert bringup_guestfs to a single Ansible role Luis Chamberlain
2025-06-04 14:29   ` Chuck Lever
2025-06-04 17:02     ` Luis Chamberlain

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250530175229.489925-11-cel@kernel.org \
    --to=cel@kernel.org \
    --cc=chuck.lever@oracle.com \
    --cc=kdevops@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox