Fix lint formatting and exceptions
This commit is contained in:
@@ -1,2 +1,4 @@
|
|||||||
skip_list:
|
skip_list:
|
||||||
- run-once
|
- run-once
|
||||||
|
exclude_paths:
|
||||||
|
- roles/global_defaults/defaults/main.yml
|
||||||
|
|||||||
42
main.yml
42
main.yml
@@ -35,16 +35,44 @@
|
|||||||
that:
|
that:
|
||||||
- install_type is defined and install_type in ["virtual", "physical"]
|
- install_type is defined and install_type in ["virtual", "physical"]
|
||||||
- hypervisor in ["libvirt", "proxmox", "vmware", "none"]
|
- hypervisor in ["libvirt", "proxmox", "vmware", "none"]
|
||||||
- install_type is defined and (install_type == "physical" or hypervisor in ["libvirt", "proxmox", "vmware"])
|
- >-
|
||||||
|
install_type is defined and (
|
||||||
|
install_type == "physical"
|
||||||
|
or hypervisor in ["libvirt", "proxmox", "vmware"]
|
||||||
|
)
|
||||||
- filesystem is defined and filesystem in ["btrfs", "ext4", "xfs"]
|
- filesystem is defined and filesystem in ["btrfs", "ext4", "xfs"]
|
||||||
- install_drive is defined and install_drive | length > 0
|
- install_drive is defined and install_drive | length > 0
|
||||||
- hostname is defined and hostname | length > 0
|
- hostname is defined and hostname | length > 0
|
||||||
- os is defined and os in ["archlinux", "almalinux", "debian11", "debian12", "debian13", "fedora", "rhel8", "rhel9", "rhel10", "rocky", "ubuntu", "ubuntu-lts"]
|
- >-
|
||||||
- os is defined and (os not in ["rhel8", "rhel9", "rhel10"] or (rhel_iso is defined and rhel_iso | length > 0))
|
os is defined and os in [
|
||||||
- install_type is defined and (install_type == "physical" or (boot_iso is defined and boot_iso | length > 0))
|
"archlinux", "almalinux", "debian11", "debian12", "debian13", "fedora",
|
||||||
- install_type is defined and (install_type == "physical" or (vm_cpus is defined and (vm_cpus | int) > 0))
|
"rhel8", "rhel9", "rhel10", "rocky", "ubuntu", "ubuntu-lts"
|
||||||
- install_type is defined and (install_type == "physical" or (vm_size is defined and (vm_size | float) > 0))
|
]
|
||||||
- install_type is defined and (install_type == "physical" or (vm_memory is defined and (vm_memory | float) > 0))
|
- >-
|
||||||
|
os is defined and (
|
||||||
|
os not in ["rhel8", "rhel9", "rhel10"]
|
||||||
|
or (rhel_iso is defined and rhel_iso | length > 0)
|
||||||
|
)
|
||||||
|
- >-
|
||||||
|
install_type is defined and (
|
||||||
|
install_type == "physical"
|
||||||
|
or (boot_iso is defined and boot_iso | length > 0)
|
||||||
|
)
|
||||||
|
- >-
|
||||||
|
install_type is defined and (
|
||||||
|
install_type == "physical"
|
||||||
|
or (vm_cpus is defined and (vm_cpus | int) > 0)
|
||||||
|
)
|
||||||
|
- >-
|
||||||
|
install_type is defined and (
|
||||||
|
install_type == "physical"
|
||||||
|
or (vm_size is defined and (vm_size | float) > 0)
|
||||||
|
)
|
||||||
|
- >-
|
||||||
|
install_type is defined and (
|
||||||
|
install_type == "physical"
|
||||||
|
or (vm_memory is defined and (vm_memory | float) > 0)
|
||||||
|
)
|
||||||
- >-
|
- >-
|
||||||
install_type is defined and filesystem is defined and (
|
install_type is defined and filesystem is defined and (
|
||||||
install_type == "physical"
|
install_type == "physical"
|
||||||
|
|||||||
@@ -258,6 +258,58 @@
|
|||||||
|
|
||||||
- name: Create LVM logical volumes
|
- name: Create LVM logical volumes
|
||||||
when: cis_enabled or item.lv not in ['home', 'var', 'var_log', 'var_log_audit']
|
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:
|
community.general.lvol:
|
||||||
vg: sys
|
vg: sys
|
||||||
lv: "{{ item.lv }}"
|
lv: "{{ item.lv }}"
|
||||||
@@ -265,27 +317,9 @@
|
|||||||
state: present
|
state: present
|
||||||
loop:
|
loop:
|
||||||
- lv: root
|
- lv: root
|
||||||
size: >-
|
size: "{{ partitioning_lvm_root_gb | string + 'G' }}"
|
||||||
{{ [(((((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' }}
|
|
||||||
- lv: swap
|
- lv: swap
|
||||||
size: >-
|
size: "{{ partitioning_lvm_swap_gb | string + 'G' }}"
|
||||||
{{ ((((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' }}
|
|
||||||
- lv: home
|
- lv: home
|
||||||
size: "{{ ([([(((partitioning_vm_size_effective | float) - 20) * 0.1), 2] | max), 20] | min) | string + 'G' }}"
|
size: "{{ ([([(((partitioning_vm_size_effective | float) - 20) * 0.1), 2] | max), 20] | min) | string + 'G' }}"
|
||||||
- {lv: var, size: "2G"}
|
- {lv: var, size: "2G"}
|
||||||
|
|||||||
Reference in New Issue
Block a user