Fix lint formatting and exceptions
This commit is contained in:
@@ -258,6 +258,58 @@
|
||||
|
||||
- name: Create LVM logical volumes
|
||||
when: cis_enabled or item.lv not in ['home', 'var', 'var_log', 'var_log_audit']
|
||||
vars:
|
||||
partitioning_lvm_swap_target_gb: >-
|
||||
{{
|
||||
(
|
||||
((partitioning_vm_memory_effective | float / 1024) > 16.0)
|
||||
| ternary(
|
||||
(partitioning_vm_memory_effective | float / 2048) | int,
|
||||
(partitioning_vm_memory_effective | float / 1024)
|
||||
)
|
||||
) | float
|
||||
}}
|
||||
partitioning_lvm_available_gb: >-
|
||||
{{
|
||||
(
|
||||
(partitioning_vm_size_effective | float)
|
||||
- (partitioning_reserved_gb | float)
|
||||
- (cis_enabled | ternary(7.5, 0))
|
||||
- partitioning_lvm_swap_target_gb
|
||||
) | float
|
||||
}}
|
||||
partitioning_lvm_root_gb: >-
|
||||
{{
|
||||
[
|
||||
(
|
||||
((partitioning_lvm_available_gb | float) < 4)
|
||||
| ternary(
|
||||
4,
|
||||
(
|
||||
((partitioning_lvm_available_gb | float) > 12)
|
||||
| ternary(
|
||||
((partitioning_vm_size_effective | float) * 0.4)
|
||||
| round(0, 'ceil'),
|
||||
partitioning_lvm_available_gb
|
||||
)
|
||||
)
|
||||
)
|
||||
),
|
||||
4
|
||||
] | max
|
||||
}}
|
||||
partitioning_lvm_swap_gb: >-
|
||||
{{
|
||||
((partitioning_lvm_available_gb | float) < 4)
|
||||
| ternary(
|
||||
(
|
||||
(partitioning_lvm_available_gb | float)
|
||||
+ (partitioning_lvm_swap_target_gb | float)
|
||||
- 4
|
||||
),
|
||||
partitioning_lvm_swap_target_gb
|
||||
)
|
||||
}}
|
||||
community.general.lvol:
|
||||
vg: sys
|
||||
lv: "{{ item.lv }}"
|
||||
@@ -265,27 +317,9 @@
|
||||
state: present
|
||||
loop:
|
||||
- lv: root
|
||||
size: >-
|
||||
{{ [(((((partitioning_vm_size_effective | float) - (partitioning_reserved_gb | float) - ((cis_enabled) | ternary(7.5, 0)) - (((partitioning_vm_memory_effective | float / 1024) > 16.0)
|
||||
| ternary(((partitioning_vm_memory_effective | float / 2048) | int), (partitioning_vm_memory_effective | float / 1024)))) < 4)
|
||||
| ternary(4,((((partitioning_vm_size_effective | float) - (partitioning_reserved_gb | float) - ((cis_enabled) | ternary(7.5, 0)) -
|
||||
(((partitioning_vm_memory_effective | float / 1024) > 16.0)
|
||||
| ternary(
|
||||
((partitioning_vm_memory_effective | float / 2048) | int),
|
||||
(partitioning_vm_memory_effective | float / 1024)
|
||||
)))
|
||||
> 12)
|
||||
| ternary(((partitioning_vm_size_effective | float) * 0.4) | round(0, 'ceil'),((partitioning_vm_size_effective | float) - (partitioning_reserved_gb | float) - ((cis_enabled)
|
||||
| ternary(7.5, 0)) - (((partitioning_vm_memory_effective | float / 1024) > 16.0)
|
||||
| ternary(((partitioning_vm_memory_effective | float / 2048) | int), (partitioning_vm_memory_effective | float / 1024))))))))), 4 ] | max | string +
|
||||
'G' }}
|
||||
size: "{{ partitioning_lvm_root_gb | string + 'G' }}"
|
||||
- lv: swap
|
||||
size: >-
|
||||
{{ ((((partitioning_vm_size_effective | float) - (partitioning_reserved_gb | float) - ((cis_enabled) | ternary(7.5, 0))) - (((partitioning_vm_memory_effective | float / 1024) > 16.0)
|
||||
| ternary(((partitioning_vm_memory_effective | float / 2048) | int), (partitioning_vm_memory_effective | float / 1024)))) < 4)
|
||||
| ternary((((partitioning_vm_size_effective | float) - (partitioning_reserved_gb | float) - ((cis_enabled) | ternary(7.5, 0))) - 4), (((partitioning_vm_memory_effective | float / 1024)
|
||||
> 16.0)
|
||||
| ternary(((partitioning_vm_memory_effective | float / 2048) | int), (partitioning_vm_memory_effective | float / 1024)))) | string + 'G' }}
|
||||
size: "{{ partitioning_lvm_swap_gb | string + 'G' }}"
|
||||
- lv: home
|
||||
size: "{{ ([([(((partitioning_vm_size_effective | float) - 20) * 0.1), 2] | max), 20] | min) | string + 'G' }}"
|
||||
- {lv: var, size: "2G"}
|
||||
|
||||
Reference in New Issue
Block a user