Add a few things; nfs_lazy_reboot2.yml/nfs_lazy_reboot3.yml are valid; v2 is best POC

This commit is contained in:
2025-07-30 16:49:16 -04:00
parent 6bcacd8a97
commit 35476c9b25
11 changed files with 405 additions and 26 deletions

23
nfs_lazy_reboot_debug.yml Normal file
View File

@ -0,0 +1,23 @@
---
- name: Gather NFS mounts without using Ansible facts
hosts: temp
gather_facts: false
tasks:
- name: Check for mounted NFS shares 🔎 # noqa: command-instead-of-module
ansible.builtin.command: mount -t nfs,nfs4
register: nfs_mounts_result
changed_when: false
failed_when: nfs_mounts_result.rc not in [0, 32]
- name: Debug nfs_mounts_result 🔎
ansible.builtin.debug:
msg: "{{ nfs_mounts_result }}"
- name: Create a list of NFS mount points from command output 📝
ansible.builtin.set_fact:
nfs_mount_list: "{{ nfs_mounts_result.stdout_lines | map('split') | map(attribute=2) | list }}"
- name: Display the discovered NFS mount points ✅
ansible.builtin.debug:
msg: "Discovered NFS mounts: {{ nfs_mount_list }}"