Add a few things; nfs_lazy_reboot2.yml/nfs_lazy_reboot3.yml are valid; v2 is best POC
This commit is contained in:
23
nfs_lazy_reboot_debug.yml
Normal file
23
nfs_lazy_reboot_debug.yml
Normal 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 }}"
|
Reference in New Issue
Block a user