-
Notifications
You must be signed in to change notification settings - Fork 3
/
ubuntu.json
100 lines (100 loc) · 3.08 KB
/
ubuntu.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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
{
"variables": {
"build_name": "ubuntu",
"iso_url": "http://releases.ubuntu.com/14.04/ubuntu-14.04.2-server-amd64.iso",
"aws_source_ami": "ami-c8cf3ba0",
"aws_access_key": "{{env `AWS_ACCESS_KEY_ID`}}",
"aws_secret_key": "{{env `AWS_SECRET_ACCESS_KEY`}}",
"aws_account_id": "884882099534",
"aws_region": "us-east-1",
"aws_instance_type": "c3.large",
"aws_s3_bucket": "devops.cloudspace.com",
"aws_security_group": "default",
"username": "vagrant",
"password": "vagrant"
},
"provisioners": [{
"type": "shell",
"scripts": [
"packer-shell-scripts/sudoers-nopasswd.sh",
"packer-shell-scripts/install-virtualbox-guest-additions.sh",
"packer-shell-scripts/add-vagrant-key.sh"
],
"only": ["virtualbox"],
"pause_before": "4s"
},
{
"type": "shell",
"scripts": [
"packer-shell-scripts/base.sh",
"packer-shell-scripts/redis.sh",
"packer-shell-scripts/memcached.sh"
],
"pause_before": "4s"
}],
"builders": [{
"name": "aws",
"type": "amazon-ebs",
"access_key": "{{user `aws_access_key`}}",
"secret_key": "{{user `aws_secret_key`}}",
"region": "{{user `aws_region`}}",
"source_ami": "{{user `aws_source_ami`}}",
"instance_type": "{{user `aws_instance_type`}}",
"ssh_username": "ubuntu",
"ami_name": "{{user `build_name`}}-{{timestamp}}",
"ami_groups": ["all"],
"security_group_id": "{{user `aws_security_group`}}",
"tags": {
"Name": "packer",
"Name": "{{user `build_name`}}"
},
"user_data": ""
},{
"name": "virtualbox",
"type": "virtualbox-iso",
"vm_name": "{{user `build_name`}}",
"output_directory": "./builds/{{user `build_name`}}",
"iso_url": "{{user `iso_url`}}",
"iso_checksum": "83aabd8dcf1e8f469f3c72fff2375195",
"iso_checksum_type": "md5",
"ssh_username": "{{user `username`}}",
"ssh_password": "{{user `password`}}",
"guest_os_type": "Ubuntu_64",
"guest_additions_path": "VBoxGuestAdditions_{{.Version}}.iso",
"virtualbox_version_file": ".vbox_version",
"vboxmanage_post": [
[
"modifyvm",
"{{.Name}}",
"--memory",
"2048"
],
[
"modifyvm",
"{{.Name}}",
"--cpus",
"2"
]
],
"http_directory": "http",
"ssh_wait_timeout": "45m",
"boot_command": [
"<esc><esc><enter><wait>",
"/install/vmlinuz noapic ",
"preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg ",
"debian-installer=en_US auto locale=en_US kbd-chooser/method=us ",
"hostname={{user `build_name`}} ",
"fb=false debconf/frontend=noninteractive ",
"keyboard-configuration/modelcode=SKIP keyboard-configuration/layout=USA ",
"keyboard-configuration/variant=USA console-setup/ask_detect=false ",
"initrd=/install/initrd.gz -- <enter>"
],
"shutdown_command": "sudo shutdown -P now"
}],
"post-processors": [{
"output": "./builds/{{user `build_name`}}/{{user `build_name`}}.box",
"type": "vagrant",
"keep_input_artifact": true,
"only": ["virtualbox"]
}]
}