-
Notifications
You must be signed in to change notification settings - Fork 0
/
wcs-ami.json
53 lines (53 loc) · 1.41 KB
/
wcs-ami.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
{
"variables": {
"aws_access_key": "",
"aws_secret_key": ""
},
"builders": [{
"type": "amazon-ebs",
"access_key": "{{user `aws_access_key`}}",
"secret_key": "{{user `aws_secret_key`}}",
"region": "us-east-1",
"source_ami_filter": {
"filters": {
"virtualization-type": "hvm",
"name": "ubuntu/images/hvm-ssd/*ubuntu-bionic-18.04-amd64-server-*",
"root-device-type": "ebs"
},
"owners": ["099720109477"],
"most_recent": true
},
"instance_type": "t3.micro",
"ssh_username": "ubuntu",
"ami_name": "wcs-ami {{timestamp}}",
"ami_block_device_mappings": [{
"device_name": "/dev/sda1",
"delete_on_termination": "true",
"volume_size": 30,
"volume_type": "gp2"
}]
}],
"provisioners": [{
"type": "shell",
"inline": [
"sudo mkdir -p /usr/local/etc/wcs/ami/bootstrap-cookbooks",
"sudo chown -R ubuntu:ubuntu /usr/local/etc/wcs/ami"
]
}, {
"type": "file",
"source": "cookbooks/bootstrap/",
"destination": "/usr/local/etc/wcs/ami/bootstrap-cookbooks"
}, {
"type": "chef-solo",
"version": "14.2.0-1",
"cookbook_paths": "cookbooks/provision",
"run_list": ["recipe[wcsprov]"]
}, {
"type": "shell",
"inline": [
"sudo rm -rf /tmp/packer-chef-solo",
"sudo rm -f /home/ubuntu/.ssh/authorized_keys",
"sudo rm -f /root/.ssh/authorized_keys"
]
}]
}