27 lines
609 B
YAML
27 lines
609 B
YAML
---
|
|
- name: Something
|
|
hosts: temp
|
|
become: true
|
|
gather_facts: true
|
|
|
|
vars:
|
|
__nfs_src: 10.10.42.180
|
|
__nfs_share: /backups
|
|
__nfs_mnt_pnt: /nfs/backups
|
|
|
|
tasks:
|
|
- name: Verify mount status and reboot
|
|
block:
|
|
- name: Verify mount status
|
|
ansible.builtin.command: df
|
|
timeout: 5
|
|
|
|
rescue:
|
|
- name: Lazily unmount the NFS share
|
|
ansible.builtin.command: "umount -f -l {{ __nfs_mnt_pnt }}"
|
|
|
|
always:
|
|
- name: Reboot host if file changes # noqa: no-handler
|
|
ansible.builtin.import_role:
|
|
name: verified_reboot
|