Files
k3s-ansible/roles/reset/tasks/umount_with_children.yml
Richard Holmboe 48f5096a1a Change to FQCN with ansible-lint fixer
Since ansible-base 2.10 (later ansible-core), FQCN is the new way to go.

Updated .ansible-lint with a production profile and removed fqcn in skip_list.
Updated .yamllint with rules needed.

Ran ansible-lint --fix=all, then manually applied some minor changes.
2024-08-02 09:18:06 +02:00

16 lines
500 B
YAML

---
- name: Get the list of mounted filesystems
ansible.builtin.shell: set -o pipefail && cat /proc/mounts | awk '{ print $2}' | grep -E "^{{ mounted_fs }}"
register: get_mounted_filesystems
args:
executable: /bin/bash
failed_when: false
changed_when: get_mounted_filesystems.stdout | length > 0
check_mode: false
- name: Umount filesystem
ansible.posix.mount:
path: "{{ item }}"
state: unmounted
with_items: "{{ get_mounted_filesystems.stdout_lines | reverse | list }}"