-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathpacker-vhd-centos.json
52 lines (49 loc) · 1.95 KB
/
packer-vhd-centos.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
{
"variables": {
"subscription_id": "{{env `AZURE_SUBSCRIPTION_ID`}}",
"tenant_id": "{{env `AZURE_TENANT_ID`}}",
"client_id": "{{env `AZURE_CLIENT_ID`}}",
"client_secret": "{{env `AZURE_CLIENT_SECRET`}}",
"location": "eastus2",
"storage_resource_group": "",
"storage_account": ""
},
"sensitive-variables": ["client_secret"],
"builders": [{
"type": "azure-arm",
"subscription_id": "{{user `subscription_id`}}",
"tenant_id": "{{user `tenant_id`}}",
"client_id": "{{user `client_id`}}",
"client_secret": "{{user `client_secret`}}",
"os_type": "Linux",
"image_publisher": "OpenLogic",
"image_offer": "CentOS",
"image_sku": "8_2",
"image_version": "latest",
"location": "{{user `location`}}",
"vm_size": "Standard_DS2_v2",
"temp_resource_group_name": "packer-rg",
"temp_compute_name": "packervm",
"private_virtual_network_with_public_ip": true,
"custom_data_file": "",
"polling_duration_timeout": "0h30m0s",
"resource_group_name": "{{user `storage_resource_group`}}",
"storage_account": "{{user `storage_account`}}",
"capture_container_name": "packer",
"capture_name_prefix": "centos82"
}
],
"provisioners": [{
"type": "shell",
"inline_shebang": "/bin/sh -x -e",
"execute_command": "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'",
"inline": [
"yum update",
"yum install epel-release",
"yum install nginx",
"mkdir -p /my_custom_folder",
"echo 'Hello from Packer' > /my_custom_folder/hello.txt",
"waagent -force -deprovision+user && export HISTSIZE=0 && sync"
]
}]
}