-
Notifications
You must be signed in to change notification settings - Fork 807
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert legacy Packer json template to hcl2 template (#247)
* convert legacy Packer json template to hcl2 template
- Loading branch information
1 parent
bb15543
commit f2a6901
Showing
12 changed files
with
324 additions
and
105 deletions.
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
output "vmss_public_ip_fqdn" { | ||
value = azurerm_public_ip.vmss.fqdn | ||
value = azurerm_public_ip.vmss.fqdn | ||
} | ||
|
||
output "jumpbox_public_ip_fqdn" { | ||
value = azurerm_public_ip.jumpbox.fqdn | ||
value = azurerm_public_ip.jumpbox.fqdn | ||
} | ||
|
||
output "jumpbox_public_ip" { | ||
value = azurerm_public_ip.jumpbox.ip_address | ||
} | ||
value = azurerm_public_ip.jumpbox.ip_address | ||
} |
6 changes: 6 additions & 0 deletions
6
quickstart/201-vmss-packer-jumpbox/packer_image_resource_group/main.tf
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
resource "random_pet" "id" {} | ||
|
||
resource "azurerm_resource_group" "image_group" { | ||
location = "eastus" | ||
name = "packer-image-${random_pet.id.id}" | ||
} |
3 changes: 3 additions & 0 deletions
3
quickstart/201-vmss-packer-jumpbox/packer_image_resource_group/outputs.tf
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
output "resource_group_name" { | ||
value = azurerm_resource_group.image_group.name | ||
} |
26 changes: 26 additions & 0 deletions
26
quickstart/201-vmss-packer-jumpbox/packer_image_resource_group/providers.tf
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
terraform { | ||
required_version = ">=1.2" | ||
|
||
required_providers { | ||
azurerm = { | ||
source = "hashicorp/azurerm" | ||
version = "~> 3.0" | ||
} | ||
helm = { | ||
source = "hashicorp/helm" | ||
version = "2.9.0" | ||
} | ||
random = { | ||
source = "hashicorp/random" | ||
version = "~> 3.0" | ||
} | ||
} | ||
} | ||
|
||
provider "azurerm" { | ||
features { | ||
resource_group { | ||
prevent_deletion_if_contains_resources = false | ||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,38 @@ | ||
{ | ||
"builders": [{ | ||
"type": "azure-arm", | ||
"client_id": "0bfc2293-4d69-49b5-83f7-bf0d60d20c45", | ||
"client_secret": "G3.6ytCh44Kcla~_JRPBDLkzsXLOa3edDL", | ||
"tenant_id": "c3fd441d-b8ad-487e-aa27-453079018fca", | ||
"subscription_id": "b162117f-53fa-4f42-8c77-6a65ca966c40", | ||
"managed_image_resource_group_name": "myPackerImages", | ||
"managed_image_name": "myPackerImage", | ||
"os_type": "Linux", | ||
"image_publisher": "Canonical", | ||
"image_offer": "UbuntuServer", | ||
"image_sku": "16.04-LTS", | ||
"azure_tags": { | ||
"dept": "Engineering", | ||
"task": "Image deployment" | ||
}, | ||
"location": "East US", | ||
"vm_size": "Standard_DS2_v2" | ||
}], | ||
"provisioners": [{ | ||
"execute_command": "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'", | ||
"inline": [ | ||
"apt-get update", | ||
"apt-get upgrade -y", | ||
"apt-get -y install nginx", | ||
"/usr/sbin/waagent -force -deprovision+user && export HISTSIZE=0 && sync" | ||
], | ||
"inline_shebang": "/bin/sh -x", | ||
"type": "shell" | ||
}] | ||
} | ||
"builders": [{ | ||
"type": "azure-arm", | ||
|
||
"client_id": "0bfc2293-4d69-49b5-83f7-bf0d60d20c45", | ||
"client_secret": "G3.6ytCh44Kcla~_JRPBDLkzsXLOa3edDL", | ||
"tenant_id": "c3fd441d-b8ad-487e-aa27-453079018fca", | ||
"subscription_id": "b162117f-53fa-4f42-8c77-6a65ca966c40", | ||
|
||
"managed_image_resource_group_name": "myPackerImages", | ||
"managed_image_name": "myPackerImage", | ||
|
||
"os_type": "Linux", | ||
"image_publisher": "Canonical", | ||
"image_offer": "UbuntuServer", | ||
"image_sku": "16.04-LTS", | ||
|
||
"azure_tags": { | ||
"dept": "Engineering", | ||
"task": "Image deployment" | ||
}, | ||
|
||
"location": "East US", | ||
"vm_size": "Standard_DS2_v2" | ||
}], | ||
"provisioners": [{ | ||
"execute_command": "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'", | ||
"inline": [ | ||
"apt-get update", | ||
"apt-get upgrade -y", | ||
"apt-get -y install nginx", | ||
|
||
"/usr/sbin/waagent -force -deprovision+user && export HISTSIZE=0 && sync" | ||
], | ||
"inline_shebang": "/bin/sh -x", | ||
"type": "shell" | ||
}] | ||
} |
Oops, something went wrong.