diff options
Diffstat (limited to 'packer.yaml')
-rw-r--r-- | packer.yaml | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/packer.yaml b/packer.yaml new file mode 100644 index 0000000..75ac5b2 --- /dev/null +++ b/packer.yaml | |||
@@ -0,0 +1,73 @@ | |||
1 | builders: | ||
2 | - type: amazon-ebssurrogate | ||
3 | |||
4 | ### Builder Instance Details | ||
5 | |||
6 | region: '{{user `build_region`}}' | ||
7 | subnet_id: '{{user `build_subnet`}}' | ||
8 | security_group_id: '{{user `build_security_group`}}' | ||
9 | instance_type: '{{user `build_instance_type`}}' | ||
10 | associate_public_ip_address: '{{user `build_public_ip`}}' | ||
11 | source_ami_filter: | ||
12 | # use the latest Amazon Linux AMI | ||
13 | owners: | ||
14 | - '{{user `build_ami_owner`}}' | ||
15 | most_recent: '{{user `build_ami_latest`}}' | ||
16 | filters: | ||
17 | virtualization-type: hvm | ||
18 | root-device-type: ebs | ||
19 | architecture: '{{user `build_arch`}}' | ||
20 | name: '{{user `build_ami_name`}}' | ||
21 | launch_block_device_mappings: | ||
22 | - volume_type: gp2 | ||
23 | device_name: /dev/xvdf | ||
24 | delete_on_termination: 'true' | ||
25 | volume_size: '{{user `ami_volume_size`}}' | ||
26 | ssh_username: '{{user `build_user`}}' | ||
27 | |||
28 | ### AMI Build Details | ||
29 | |||
30 | ami_name: '{{user `ami_name_prefix`}}{{user `release`}}-{{user `revision`}}-{{user `arch`}}{{user `ami_name_suffix`}}' | ||
31 | ami_description: '{{user `ami_desc_prefix`}}{{user `release`}}-{{user `revision`}} {{user `arch`}}{{user `ami_desc_suffix`}}' | ||
32 | ami_virtualization_type: hvm | ||
33 | ami_root_device: | ||
34 | volume_type: gp2 | ||
35 | source_device_name: /dev/xvdf | ||
36 | device_name: /dev/xvda | ||
37 | delete_on_termination: 'true' | ||
38 | volume_size: '{{user `ami_volume_size`}}' | ||
39 | encrypt_boot: '{{user `ami_encrypt`}}' | ||
40 | ena_support: 'true' | ||
41 | sriov_support: 'true' | ||
42 | ami_groups: '{{user `ami_access`}}' | ||
43 | ami_regions: '{{user `ami_regions`}}' | ||
44 | |||
45 | |||
46 | provisioners: | ||
47 | - type: file | ||
48 | source: nvme/ | ||
49 | destination: /tmp | ||
50 | - type: shell | ||
51 | script: setup-ami.sh | ||
52 | environment_vars: | ||
53 | - "VERSION='{{user `version`}}'" | ||
54 | - "RELEASE='{{user `release`}}'" | ||
55 | - "REVISION='{{user `revision`}}'" | ||
56 | - "ARCH='{{user `arch`}}'" | ||
57 | - "REPOS='{{user `repos`}}'" | ||
58 | - "PKGS='{{user `pkgs`}}'" | ||
59 | - "SVCS='{{user `svcs`}}'" | ||
60 | execute_command: 'sudo sh -c "{{ .Vars }} {{ .Path }}"' | ||
61 | |||
62 | |||
63 | post-processors: | ||
64 | - type: manifest | ||
65 | output: 'profile/{{user `profile_build`}}/manifest.json' | ||
66 | custom_data: | ||
67 | profile: '{{user `profile`}}' | ||
68 | build: '{{user `profile_build`}}' | ||
69 | arch: '{{user `arch`}}' | ||
70 | version: '{{user `version`}}' | ||
71 | release: '{{user `release`}}' | ||
72 | revision: '{{user `revision`}}' | ||
73 | end_of_life: '{{user `end_of_life`}}' | ||