fix(tasks): stop reporting a change when looking up the btrfs device

`findmnt` only reads the mount table, but the task declared `changed_when` on a successful return code and therefore
reported a change on every single run. Any btrfs backed user made the whole play non idempotent, which an idempotence
check would flag as soon as one exists.

The `failed_when` on a non zero return code is dropped along with it, since that is exactly what the command module does
by default.

Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
2026-09-09 21:39:42 +02:00
co-authored by Copilot
parent 68ee8ebbcd
commit c34b59633c
+1 -2
View File
@@ -12,8 +12,7 @@
ansible.builtin.command: ansible.builtin.command:
cmd: /bin/bash -c "findmnt -no SOURCE -T {{ user_user_home }} | sed 's/\[.*\]//'" cmd: /bin/bash -c "findmnt -no SOURCE -T {{ user_user_home }} | sed 's/\[.*\]//'"
register: _unix_users_btrfs_device register: _unix_users_btrfs_device
failed_when: _unix_users_btrfs_device.rc != 0 changed_when: false
changed_when: _unix_users_btrfs_device.rc == 0
- name: "Determine filesystem of device" - name: "Determine filesystem of device"
ansible.builtin.set_fact: ansible.builtin.set_fact: