-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathPacker-VMRHEL73-NGNIX-Azure-squasta.json
52 lines (43 loc) · 1.54 KB
/
Packer-VMRHEL73-NGNIX-Azure-squasta.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
{
"_comment": "This Packer File generated a Red Hat Enterprise Linux 7.3 image with NGNIX on Azure",
"builders": [
{
"type": "azure-arm",
"client_id": "put here your client id",
"client_secret": "put here your client secret",
"resource_group_name": "RG-Packer1-Stan",
"storage_account": "storageaccountpackerstan",
"subscription_id": "put here your Azure Subscription ID",
"tenant_id": "put here your tenant = Azure AD ID",
"capture_container_name": "imagesstan",
"capture_name_prefix": "packerstan",
"os_type": "Linux",
"image_publisher": "RedHat",
"image_offer": "RHEL",
"image_sku": "7.3",
"azure_tags": {
"madewith": "HashiCorp Packer",
"Creator" : "Stan"
},
"location": "West Europe",
"vm_size": "Standard_D4_v2"
}
],
"provisioners": [
{
"execute_command": "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'",
"inline_shebang": "/bin/sh -x",
"type": "shell",
"inline": [
"sleep 30",
"sudo rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm",
"sudo rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm",
"sudo yum -y update",
"sudo yum -y install nginx18",
"sudo systemctl enable nginx.service",
"sudo systemctl start nginx.service",
"firewall-cmd --permanent --zone=public --add-port=80/tcp",
"/usr/sbin/waagent -force -deprovision+user && export HISTSIZE=0 && sync"
]
}]
}