Add swap_enabled toggle for swap setup
This commit is contained in:
@@ -40,7 +40,9 @@
|
||||
changed_when: false
|
||||
|
||||
- name: Make root subvolumes
|
||||
when: cis_enabled or item.subvol not in ['var_log_audit']
|
||||
when:
|
||||
- cis_enabled or item.subvol not in ['var_log_audit']
|
||||
- swap_enabled | bool or item.subvol != 'swap'
|
||||
ansible.builtin.command: btrfs su cr /mnt/{{ '@' if item.subvol == 'root' else '@' + item.subvol }}
|
||||
args:
|
||||
creates: /mnt/{{ '@' if item.subvol == 'root' else '@' + item.subvol }}
|
||||
@@ -63,6 +65,7 @@
|
||||
changed_when: false
|
||||
|
||||
- name: Create a Btrfs swap file
|
||||
when: swap_enabled | bool
|
||||
ansible.builtin.command: >-
|
||||
btrfs filesystem mkswapfile --size {{ partitioning_swap_size_gb }}g --uuid clear /mnt/@swap/swapfile
|
||||
args:
|
||||
|
||||
Reference in New Issue
Block a user