-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpacker.json
53 lines (53 loc) · 1.83 KB
/
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
{
"variables": {
"homefolder": "{{env `HOME`}}",
"aws_region": "us-east-1",
"aws_instance_type": "t2.micro",
"aws_ami_name": "ami_packer",
"aws_ami_name_pattern": "ubuntu/images/*ubuntu-focal-20.04-amd64*",
"aws_ami_owner": "099720109477",
"aws_ami_ssh_username": "ubuntu",
"aws_os_version": "Amazon Linux",
"aws_os_release": "Latest"
},
"sensitive-variables": ["aws_ami_owner", "aws_ami_name_pattern"],
"builders": [
{
"type": "amazon-ebs",
"region": "{{user `aws_region`}}",
"source_ami_filter": {
"filters": {
"virtualization-type": "hvm",
"name": "{{user `aws_ami_name_pattern`}}",
"root-device-type": "ebs",
"architecture": "x86_64"
},
"owners": ["{{user `aws_ami_owner`}}"],
"most_recent": true
},
"instance_type": "{{user `aws_instance_type`}}",
"ssh_username": "{{user `aws_ami_ssh_username`}}",
"ami_name": "{{user `aws_ami_name`}}-{{ timestamp }}",
"ami_description": "from .{{ .SourceAMI }}",
"tags": {
"OS_Version": "{{user `aws_os_version`}}",
"Release": "{{user `aws_os_release`}}",
"Base_AMI_Name": "{{ .SourceAMIName }}"
}
}
],
"provisioners": [
{
"type": "ansible",
"playbook_file": "./playbook.yml",
"user": "ubuntu",
"extra_arguments": [ "--extra-vars", "ansible_python_interpreter=/usr/bin/python3" ],
"ansible_env_vars": [ "ANSIBLE_HOST_KEY_CHECKING=False" ]
}
],
"post-processors": [
{
"type": "manifest"
}
]
}