# Swap file module

**URL:** <https://forum.ansible.com/t/swap-file-module/40398>\
**Category:** Collection Development\
**Tags:** module\
**Created:** [February 20, 2025, 3:30pm UTC](https://forum.ansible.com/t/swap-file-module/40398 "2025-02-20T15:30:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![basicvglass](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/basicvglass/32/7647_2.png) [@basicvglass](https://forum.ansible.com/u/basicvglass)\
**Post date:** [February 20, 2025, 3:30pm UTC](https://forum.ansible.com/t/swap-file-module/40398/1 "2025-02-20T15:30:57Z")

</div>

I published a collection with a swap file module a little over a year ago. It will automatically choose fallocate based on kernel version and filesystem type, can handle creating swap files on BTRFS and won’t leave the system in an unexpected state if it fails or is interrupted.

[basicbind.swap\_file](https://github.com/basicbind/ansible-collection-basicbind.swap_file)
