28 lines
938 B
YAML
28 lines
938 B
YAML
---
|
|
- name: Create and format ext4 logical volumes
|
|
when: system_cfg.features.cis.enabled or item.lv not in ['home', 'var', 'var_log', 'var_log_audit']
|
|
community.general.filesystem:
|
|
dev: /dev/sys/{{ item.lv }}
|
|
fstype: ext4
|
|
force: true
|
|
loop:
|
|
- { lv: root }
|
|
- { lv: home }
|
|
- { lv: var }
|
|
- { lv: var_log }
|
|
- { lv: var_log_audit }
|
|
|
|
- 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 or item.lv not in ['home', 'var', 'var_log', 'var_log_audit'])
|
|
ansible.builtin.command: tune2fs -O "^orphan_file,^metadata_csum_seed" "/dev/sys/{{ item.lv }}"
|
|
loop:
|
|
- { lv: root }
|
|
- { lv: home }
|
|
- { lv: var }
|
|
- { lv: var_log }
|
|
- { lv: var_log_audit }
|
|
register: partitioning_ext4_tune_result
|
|
changed_when: partitioning_ext4_tune_result.rc == 0
|