Skip to content

Instantly share code, notes, and snippets.

@devops-rob
Created May 26, 2020 20:40
Show Gist options
  • Save devops-rob/824dc7f52be14a3b6258f48ce00cdc5f to your computer and use it in GitHub Desktop.
Save devops-rob/824dc7f52be14a3b6258f48ce00cdc5f to your computer and use it in GitHub Desktop.
{
"variables": {
"image_version": "1.0.0",
"consul_version": "1.2.3",
"cost_centre": "OII",
"vm_size": "Standard_D2_v3"
},
"builders": [
{
"type": "azure-arm",
"subscription_id": "",
"location": "westeurope",
"cloud_environment_name": "Public",
"temp_resource_group_name": "builder-consul-centos-rg",
"async_resourcegroup_delete": true,
"temp_compute_name": "tconsul-centos-packer-vm",
"private_virtual_network_with_public_ip": true,
"managed_image_name": "consul_centos",
"managed_image_resource_group_name": "HashicorpImageGalleryRG",
"shared_image_gallery_destination": {
"resource_group": "HashicorpImageGalleryRG",
"gallery_name": "HashicorpImageGallery",
"image_name": "consul_centos",
"image_version": "{{user `image_version`}}",
"replication_regions": [
"North Europe",
"West Europe"
]
},
"os_type": "Linux",
"image_publisher": "OpenLogic",
"image_offer": "CentOS",
"image_sku": "7.5",
"image_version": "latest",
"vm_size": "{{user `vm_size`}}",
"azure_tags": {
"Version": "{{user `image_version`}}",
"CostCentre": "{{user `cost_centre`}}",
"consulVersion": "{{user `consul_version`}}"
}
}
],
"provisioners": [
{
"type": "ansible",
"playbook_file": "consul/bootstrap.yml"
},
{
"execute_command": "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'",
"inline": [
"/usr/sbin/waagent -force -deprovision+user && export HISTSIZE=0 && sync"
],
"inline_shebang": "/bin/sh -x",
"type": "shell"
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment