From dd122d0583f1c5a2622d9940f610893be07d703c Mon Sep 17 00:00:00 2001 From: Myroslav Levchyk Date: Fri, 29 Mar 2024 12:00:06 +0200 Subject: [PATCH 1/2] fix: vmss os update policy --- README.md | 1 + main.tf | 5 +++++ variables.tf | 9 +++++++++ 3 files changed, 15 insertions(+) diff --git a/README.md b/README.md index f531bf1..8966e7d 100644 --- a/README.md +++ b/README.md @@ -81,6 +81,7 @@ No modules. | [source\_image\_reference](#input\_source\_image\_reference) | Objects to configure source image reference for Virtual Machine Scale Sets |
object({
publisher = string
offer = string
sku = string
version = string
})
|
{
"offer": "0001-com-ubuntu-server-jammy",
"publisher": "Canonical",
"sku": "22_04-lts",
"version": "latest"
}
| no | | [subnet\_id](#input\_subnet\_id) | The ID of the Subnet where this Network first Interface should be located in. | `string` | n/a | yes | | [tags](#input\_tags) | list of tags | `map(string)` | `{}` | no | +| [automatic\_os\_upgrade\_policy](#input\_automatic\_os\_upgrade\_policy) | Configuration options for automatic os upgrade policy |
object({
disable_automatic_rollback = optional(bool, false)
enable_automatic_os_upgrade = optional(bool, false)
})
| `{}` | no | ## Outputs diff --git a/main.tf b/main.tf index e13c893..31aa798 100644 --- a/main.tf +++ b/main.tf @@ -46,6 +46,11 @@ resource "azurerm_linux_virtual_machine_scale_set" "this" { } } + automatic_os_upgrade_policy { + disable_automatic_rollback = var.automatic_os_upgrade_policy.disable_automatic_rollback + enable_automatic_os_upgrade = var.automatic_os_upgrade_policy.enable_automatic_os_upgrade + } + boot_diagnostics { storage_account_uri = null } diff --git a/variables.tf b/variables.tf index 833dfc9..745e1ea 100644 --- a/variables.tf +++ b/variables.tf @@ -176,3 +176,12 @@ variable "dependency_agent_extension_version" { description = "Version of VMSS extension required for logging" default = "9.5" } + +variable "automatic_os_upgrade_policy" { + description = "Configuration options for automatic os upgrade policy" + type = object({ + disable_automatic_rollback = optional(bool, false) + enable_automatic_os_upgrade = optional(bool, false) + }) + default = {} +} From 317e3266066f78538521e717fdebf5ff48a6c772 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 29 Mar 2024 10:03:24 +0000 Subject: [PATCH 2/2] terraform-docs: automated action --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8966e7d..c2889a9 100644 --- a/README.md +++ b/README.md @@ -59,6 +59,7 @@ No modules. |------|-------------|------|---------|:--------:| | [admin\_ssh\_key](#input\_admin\_ssh\_key) | Objects to configure ssh key reference for Virtual Machine Scale Sets |
object({
username = optional(string, "azureuser")
public_key = string
})
|
{
"public_key": null,
"username": null
}
| no | | [analytics\_workspace\_id](#input\_analytics\_workspace\_id) | Resource ID of Log Analytics Workspace | `string` | `null` | no | +| [automatic\_os\_upgrade\_policy](#input\_automatic\_os\_upgrade\_policy) | Configuration options for automatic os upgrade policy |
object({
disable_automatic_rollback = optional(bool, false)
enable_automatic_os_upgrade = optional(bool, false)
})
| `{}` | no | | [data\_collection\_rule\_association\_name](#input\_data\_collection\_rule\_association\_name) | Data collection rule association name | `string` | `null` | no | | [data\_collection\_rule\_name](#input\_data\_collection\_rule\_name) | Data collection rule name | `string` | `null` | no | | [datasource\_name](#input\_datasource\_name) | Datasource syslog name | `string` | `"datasource-syslog"` | no | @@ -81,7 +82,6 @@ No modules. | [source\_image\_reference](#input\_source\_image\_reference) | Objects to configure source image reference for Virtual Machine Scale Sets |
object({
publisher = string
offer = string
sku = string
version = string
})
|
{
"offer": "0001-com-ubuntu-server-jammy",
"publisher": "Canonical",
"sku": "22_04-lts",
"version": "latest"
}
| no | | [subnet\_id](#input\_subnet\_id) | The ID of the Subnet where this Network first Interface should be located in. | `string` | n/a | yes | | [tags](#input\_tags) | list of tags | `map(string)` | `{}` | no | -| [automatic\_os\_upgrade\_policy](#input\_automatic\_os\_upgrade\_policy) | Configuration options for automatic os upgrade policy |
object({
disable_automatic_rollback = optional(bool, false)
enable_automatic_os_upgrade = optional(bool, false)
})
| `{}` | no | ## Outputs