Files
Ansible-Bootstrap/roles/partitioning/tasks/ext4.yml

32 lines
1.1 KiB
YAML

---
- name: Create and format ext4 logical volumes
when: system_cfg.features.cis.enabled | bool or item.lv not in ['home', 'var', 'var_log', 'var_log_audit']
community.general.filesystem:
dev: /dev/{{ partitioning_vg_name }}/{{ item.lv }}
fstype: ext4
force: true
loop:
- { lv: root }
- { lv: home }
- { lv: var }
- { lv: var_log }
- { lv: var_log_audit }
loop_control:
label: "{{ item.lv }}"
- name: Remove Unsupported features for older Systems
when: >
(os in ['almalinux', 'rocky', 'rhel'] or (os == 'debian' and (os_version | string) == '11'))
and (system_cfg.features.cis.enabled | bool or item.lv not in ['home', 'var', 'var_log', 'var_log_audit'])
ansible.builtin.command: tune2fs -O "^orphan_file,^metadata_csum_seed" "/dev/{{ partitioning_vg_name }}/{{ item.lv }}"
loop:
- { lv: root }
- { lv: home }
- { lv: var }
- { lv: var_log }
- { lv: var_log_audit }
loop_control:
label: "{{ item.lv }}"
register: partitioning_ext4_tune_result
changed_when: partitioning_ext4_tune_result.rc == 0