Skip to content

Instantly share code, notes, and snippets.

@jesseloudon
Created November 9, 2020 23:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jesseloudon/09ecb88e350007994b26399f84afb23a to your computer and use it in GitHub Desktop.
Save jesseloudon/09ecb88e350007994b26399f84afb23a to your computer and use it in GitHub Desktop.
ansible on azure part 2
resource "azurerm_virtual_machine_extension" "vm1extension" {
name = var.vmName
virtual_machine_id = azurerm_linux_virtual_machine.vm1.id
publisher = "Microsoft.Azure.Extensions"
type = "CustomScript"
type_handler_version = "2.1"
settings = <<SETTINGS
{
"fileUris":["https://raw.githubusercontent.com/globalbao/terraform-azurerm-ansible-linux-vm/master/scripts/ubuntu-setup-ansible.sh"]
}
SETTINGS
protected_settings = <<PROTECTED_SETTINGS
{
"commandToExecute": ". ./ubuntu-setup-ansible.sh"
}
PROTECTED_SETTINGS
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment