Compare commits

...

3 Commits

4 changed files with 38 additions and 18 deletions

View File

@ -73,7 +73,6 @@ debian11:
- openssh-server
- python3
- sudo
- systemd-zram-generator
- xfsprogs
extra:
@ -178,7 +177,6 @@ rhel8:
- shim
- telnet
- vim
- zram-generator
- zstd
rhel9:

View File

@ -1,11 +1,4 @@
---
- name: Unmount /mnt recursively
when: os not in ['rhel8', 'rhel9']
become: false
ansible.builtin.command: umount -l /mnt
changed_when: result.rc == 0
register: result
- name: Setup Cleanup
when: hypervisor == "proxmox"
delegate_to: localhost

View File

@ -202,6 +202,7 @@
mode: '0644'
- name: Create zram config
when: os not in ['debian11', 'rhel8']
ansible.builtin.copy:
dest: /mnt/etc/systemd/zram-generator.conf
content: |

View File

@ -43,15 +43,43 @@
size: "{{ item.size }}"
state: present
loop:
- { lv: root, size: "{{ [(vm_size | float) - 0.5 - (((vm_memory | float / 1024) >= 16.0)
| ternary((vm_memory | float / 1024 / 2) | int, 4)) - 7.5, 1] | max | float
| round(1) | string + 'G' }}" }
- { lv: swap, size: "{{ ((vm_memory | float / 1024 >= 16.0) | ternary((vm_memory | float / 2048)
| int, [vm_memory | float / 1024, 4.0] | max)) | string + 'G' }}" }
- { lv: home, size: "2G" }
- { lv: var, size: "2G" }
- { lv: var_log, size: "2G" }
- { lv: var_log_audit, size: "1.5G" }
- lv: root
size: >-
{{ ((cis | lower == 'true') | ternary(
(((vm_size | float - ((vm_memory | float / 1024 >= 16.0) | ternary(
(vm_memory | float / 2048) | int,
[vm_memory | float / 1024, 4.0] | max
)) - 0.5 - 7.5) > 12.0) | ternary(
(vm_size | float * 0.4) | round(0, 'ceil'),
vm_size | float - ((vm_memory | float / 1024 >= 16.0) | ternary(
(vm_memory | float / 2048) | int,
[vm_memory | float / 1024, 4.0] | max
)) - 0.5 - 7.5
)),
vm_size | float - ((vm_memory | float / 1024 >= 16.0) | ternary(
(vm_memory | float / 2048) | int,
[vm_memory | float / 1024, 4.0] | max
)) - 0.5
)) | string + 'G' }}
- lv: swap
size: >-
{{ ((vm_memory | float / 1024 >= 16.0) | ternary(
(vm_memory | float / 2048) | int,
[vm_memory | float / 1024, 4.0] | max
)) | string + 'G' }}
- lv: home
size: "2G"
- lv: var
size: "2G"
- lv: var_log
size: "2G"
- lv: var_log_audit
size: "1.5G"
- name: Create filesystems
block: