samba-in-kubernetes / sit-environment

SIT (Samba Integration Testing) Framework
GNU General Public License v3.0
1 stars 7 forks source link

sit-xfs: do not recreate fs #97

Closed spuiuk closed 6 months ago

spuiuk commented 6 months ago

This problem was hit when developing the playbook with backend left to the default xfs system. Attempting to re-run the playbook to test if some changes to the playbooks were working failed at the point of creating the xfs filesystem.

At the moment the playbook forces the creation of the xfs fs. This means that when re-running the ansible playbook, we attempt to recreate a filesystem which has already been mounted. This fails causing it to fail.

By setting to false, we do not force a recreation of the filesystem if one already exists. This makes the operation idempotent allowing us to re-run the playbook.

Another option is to unmount a mounted filesystem. However it will still wipe out any filesystems on it and is thus non-idempotent.

xhernandez commented 6 months ago

Another option is to unmount a mounted filesystem. However it will still wipe out any filesystems on it and is thus non-idempotent.

I disagree here. If the filesystem is not wiped again, at the end of the playbook execution, the system state won't be the same that the initial execution of the playbook left.

Idempotent means that a given operation, even if executed many times, gives the same result as if it were executed only once. IMO the way to make it idempotent is to actually format it always.