Enforce 20GiB minimum vm_size
This commit is contained in:
@@ -173,7 +173,7 @@ These are prompted by default via `vars_prompt` in `main.yml`, but can be suppli
|
||||
| Variable | Description | Example Value |
|
||||
| ----------- | --------------------------------- | ------------- |
|
||||
| `vm_id` | Unique identifier for the VM. | `101` |
|
||||
| `vm_size` | Disk size allocated in GB. | `20` |
|
||||
| `vm_size` | Disk size allocated in GB (min 20). | `20` |
|
||||
| `vm_memory` | Amount of memory in MB. | `2048` |
|
||||
| `vm_cpus` | Number of CPU cores (virtual installs). | `4` |
|
||||
| `vm_ballo` | Ballooning memory size (optional).| `2048` |
|
||||
|
||||
@@ -52,10 +52,7 @@
|
||||
install_type == "physical"
|
||||
or (
|
||||
vm_size is defined
|
||||
and (
|
||||
(filesystem == "btrfs" and (vm_size | int) >= 10)
|
||||
or (filesystem != "btrfs" and (vm_size | int) >= 20)
|
||||
)
|
||||
and (vm_size | int) >= 20
|
||||
)
|
||||
)
|
||||
- >-
|
||||
@@ -64,7 +61,10 @@
|
||||
or (
|
||||
vm_size is defined
|
||||
and vm_memory is defined
|
||||
and filesystem is defined
|
||||
and (
|
||||
filesystem != "btrfs"
|
||||
or (
|
||||
(vm_size | float)
|
||||
>= (
|
||||
(vm_memory | float / 1024 >= 16.0)
|
||||
@@ -72,7 +72,8 @@
|
||||
(vm_memory | float / 2048),
|
||||
[vm_memory | float / 1024, 4.0] | max
|
||||
)
|
||||
+ 16
|
||||
+ 5.5
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user