|
1 | 1 | {
|
2 | 2 | "variables": {
|
3 | 3 | "aws_access_key": "{{env `AWS_ACCESS_KEY`}}",
|
4 |
| - "aws_secret_key": "{{env `AWS_SECRET_KEY`}}" |
| 4 | + "aws_secret_key": "{{env `AWS_SECRET_KEY`}}", |
| 5 | + "region": "ap-southeast-1", |
| 6 | + "source_ami": "ami-0e763a959ec839f5e", |
| 7 | + "instance_type": "t2.micro" |
5 | 8 | },
|
6 | 9 | "builders": [
|
7 | 10 | {
|
8 | 11 | "type": "amazon-ebs",
|
9 | 12 | "access_key": "{{user `aws_access_key`}}",
|
10 | 13 | "secret_key": "{{user `aws_secret_key`}}",
|
11 |
| - "region": "ap-southeast-1", |
12 |
| - "source_ami_filter": { |
13 |
| - "filters": { |
14 |
| - "virtualization-type": "hvm", |
15 |
| - "name": "ubuntu/images/*ubuntu-bionic-18.04-amd64-server-*", |
16 |
| - "root-device-type": "ebs" |
17 |
| - }, |
18 |
| - "owners": ["099720109477"], |
19 |
| - "most_recent": true |
20 |
| - }, |
21 |
| - "instance_type": "t2.micro", |
| 14 | + "region": "{{user `region`}}", |
| 15 | + "source_ami": "{{user `source_ami`}}", |
| 16 | + "instance_type": "{{user `instance_type`}}", |
22 | 17 | "ssh_username": "ubuntu",
|
23 | 18 | "ami_name": "supabase-realtime-0.7.4"
|
24 | 19 | }
|
25 | 20 | ],
|
26 | 21 | "provisioners": [
|
27 | 22 | {
|
28 | 23 | "type": "ansible",
|
29 |
| - "playbook_file": "ansible/playbook.yml" |
| 24 | + "playbook_file": "ansible/playbook.yml", |
| 25 | + "ansible_env_vars": ["ANSIBLE_SSH_ARGS='-o IdentitiesOnly=yes'"], |
| 26 | + "user": "ubuntu" |
| 27 | + }, |
| 28 | + { |
| 29 | + "execute_command": "echo 'packer' | sudo -S sh -c '{{ .Vars }} {{ .Path }}'", |
| 30 | + "type": "shell", |
| 31 | + "scripts": [ |
| 32 | + "scripts/01-test", |
| 33 | + "scripts/02-credentials_cleanup.sh", |
| 34 | + "scripts/90-cleanup.sh", |
| 35 | + "scripts/91-log_cleanup.sh", |
| 36 | + "scripts/99-img_check.sh" |
| 37 | + ] |
30 | 38 | }
|
31 | 39 | ]
|
32 | 40 | }
|
0 commit comments