Last active
January 25, 2018 17:23
-
-
Save divgo/4168c7bed33bdab28a87a40f9c771db3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
variable "dsc_key" { | |
default = "dsc_registration_key_from_portal" | |
} | |
variable "dsc_endpoint" { | |
default = "dsc_registration_url_from_portal" | |
} | |
variable dsc_config { | |
default = "node_configuration_you_want_applied__can_leave_blank" | |
} | |
resource "azurerm_virtual_machine_extension" "dsc_for_linux" { | |
name = "dsc_for_linux" | |
location = "${var.location}" | |
resource_group_name = "${var.resource_group_name}" | |
virtual_machine_name = "${var.vm_name}" | |
publisher = "Microsoft.OSTCExtensions" | |
type = "CustomScriptForLinux" | |
type_handler_version = "1.5" | |
depends_on = ["module.linux_vm"] | |
settings = <<SETTINGS | |
{ | |
"fileUris": ["https://your_storage_account_name.blob.core.windows.net/scripts/onboard_linux_to_AzureAutomationDSC.sh"] | |
} | |
SETTINGS | |
protected_settings = <<PROTECTED_SETTINGS | |
{ | |
"commandToExecute": "./onboard_linux_to_dsc.sh ${var.dsc_key} ${var.dsc_endpoint} ${var.dsc_config}", | |
"storageAccountName": "your_storage_account_name", | |
"storageAccountKey": "${var.storage_account_key}" | |
} | |
PROTECTED_SETTINGS | |
tags { | |
environment = "Production" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment