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:
@@ -12,8 +12,7 @@
|
||||
ansible.builtin.command:
|
||||
cmd: /bin/bash -c "findmnt -no SOURCE -T {{ user_user_home }} | sed 's/\[.*\]//'"
|
||||
register: _unix_users_btrfs_device
|
||||
failed_when: _unix_users_btrfs_device.rc != 0
|
||||
changed_when: _unix_users_btrfs_device.rc == 0
|
||||
changed_when: false
|
||||
|
||||
- name: "Determine filesystem of device"
|
||||
ansible.builtin.set_fact:
|
||||
|
||||
Reference in New Issue
Block a user