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 |
|
| Variable | Description | Example Value |
|
||||||
| ----------- | --------------------------------- | ------------- |
|
| ----------- | --------------------------------- | ------------- |
|
||||||
| `vm_id` | Unique identifier for the VM. | `101` |
|
| `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_memory` | Amount of memory in MB. | `2048` |
|
||||||
| `vm_cpus` | Number of CPU cores (virtual installs). | `4` |
|
| `vm_cpus` | Number of CPU cores (virtual installs). | `4` |
|
||||||
| `vm_ballo` | Ballooning memory size (optional).| `2048` |
|
| `vm_ballo` | Ballooning memory size (optional).| `2048` |
|
||||||
|
|||||||
@@ -52,10 +52,7 @@
|
|||||||
install_type == "physical"
|
install_type == "physical"
|
||||||
or (
|
or (
|
||||||
vm_size is defined
|
vm_size is defined
|
||||||
and (
|
and (vm_size | int) >= 20
|
||||||
(filesystem == "btrfs" and (vm_size | int) >= 10)
|
|
||||||
or (filesystem != "btrfs" and (vm_size | int) >= 20)
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
- >-
|
- >-
|
||||||
@@ -64,15 +61,19 @@
|
|||||||
or (
|
or (
|
||||||
vm_size is defined
|
vm_size is defined
|
||||||
and vm_memory is defined
|
and vm_memory is defined
|
||||||
|
and filesystem is defined
|
||||||
and (
|
and (
|
||||||
(vm_size | float)
|
filesystem != "btrfs"
|
||||||
>= (
|
or (
|
||||||
(vm_memory | float / 1024 >= 16.0)
|
(vm_size | float)
|
||||||
| ternary(
|
>= (
|
||||||
(vm_memory | float / 2048),
|
(vm_memory | float / 1024 >= 16.0)
|
||||||
[vm_memory | float / 1024, 4.0] | max
|
| ternary(
|
||||||
)
|
(vm_memory | float / 2048),
|
||||||
+ 16
|
[vm_memory | float / 1024, 4.0] | max
|
||||||
|
)
|
||||||
|
+ 5.5
|
||||||
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user