-
Notifications
You must be signed in to change notification settings - Fork 0
/
cloudbreak-packer.json
81 lines (81 loc) · 2.54 KB
/
cloudbreak-packer.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
{
"variables": {
"cloudbreak_version": "2.7.1",
"cloudbreak_home": "/opt/cloudbreak",
"cloudbreak_profile": "/tmp/Profile",
"cloudbreak_service": "/tmp/cloudbreak.service",
"cloudbreak_db": "/tmp/cloudbreak-db.sh",
"cloudbreak_watch": "/tmp/cloudbreak-watch.sh"
},
"builders": [
{
"type": "amazon-ebs",
"region": "us-east-2",
"instance_type": "t2.xlarge",
"ssh_username": "ec2-user",
"ami_name": "packer-aws-ebs-{{timestamp}}",
"source_ami_filter": {
"filters": {
"virtualization-type": "hvm",
"name": "amzn2-ami-hvm-2.0.20180810-x86_64-gp2",
"root-device-type": "ebs"
},
"owners": ["137112412989"],
"most_recent": true
}
}
],
"provisioners": [
{
"type": "shell",
"expect_disconnect": true,
"inline": [
"sudo yum update -y",
"sudo reboot"
]
},
{
"type": "file",
"source": "cloudbreak-db.sh",
"destination": "{{user `cloudbreak_db`}}"
},
{
"type": "file",
"source": "cloudbreak-watch.sh",
"destination": "{{user `cloudbreak_watch`}}"
},
{
"type": "file",
"source": "Profile",
"destination": "{{user `cloudbreak_profile`}}"
},
{
"type": "file",
"source": "cloudbreak.service",
"destination": "{{user `cloudbreak_service`}}"
},
{
"type": "shell",
"environment_vars": [
"CLOUDBREAK_PROFILE={{user `cloudbreak_profile`}}",
"CLOUDBREAK_HOME={{user `cloudbreak_home`}}",
"CLOUDBREAK_SERVICE={{user `cloudbreak_service`}}",
"CLOUDBREAK_DB={{user `cloudbreak_db`}}",
"CLOUDBREAK_WATCH={{user `cloudbreak_watch`}}",
"CLOUDBREAK_VERSION={{user `cloudbreak_version`}}"
],
"use_env_var_file": true,
"scripts": [
"cloudbreak-setup.sh"
],
"execute_command": "chmod +x {{.Path}}; set -a && source {{.EnvVarFile}} && set +a && sudo -E {{.Path}}"
}
],
"post-processors": [
{
"type": "manifest",
"output": "manifest.json",
"strip_path": true
}
]
}