blob: 69d4740ee0a5b6153c9631d5c545b0d3798c816b [file] [log] [blame]
Hung-Wei Chiu9708ed82021-04-14 14:20:08 -07001{
2 "variables": {
3 "ansible_roles_path": ".galaxy",
4 "aws_access_key": null,
5 "aws_security_key": null,
6 "arch": "x86_64",
7 "cloud_user_data": null,
8 "distro": null,
9 "instance_type": "t2.medium",
10 "security_group_id": null,
11 "source_ami_filter_name": null,
12 "source_ami_filter_owner": null,
13 "source_ami_filter_product_code": "",
Hung-Wei Chiubfa8fe32021-04-27 10:59:40 -070014 "vm_volume_size": "20",
Hung-Wei Chiu9708ed82021-04-14 14:20:08 -070015 "subnet_id": null,
16 "ssh_user": null
17 },
18 "builders": [
19 {
20 "name": "aws",
21 "access_key": "{{user `aws_access_key`}}",
22 "ami_name": "{{user `distro`}} - basebuild - {{user `arch`}} - {{isotime \"20060102-1504\"}}",
23 "instance_type": "{{user `instance_type`}}",
24 "region": "us-west-2",
25 "secret_key": "{{user `aws_security_key`}}",
26 "security_group_id": "{{user `security_group_id`}}",
27 "source_ami_filter": {
28 "filters": {
29 "name": "{{user `source_ami_filter_name`}}",
30 "product-code": "{{user `source_ami_filter_product_code`}}",
31 "architecture": "{{user `arch`}}",
32 "root-device-type": "ebs",
33 "virtualization-type": "hvm"
34 },
35 "most_recent": true,
36 "owners": ["{{user `source_ami_filter_owner`}}"]
37 },
38 "ssh_username": "{{user `ssh_user`}}",
39 "subnet_id": "{{user `subnet_id`}}",
40 "type": "amazon-ebs",
Hung-Wei Chiubfa8fe32021-04-27 10:59:40 -070041 "launch_block_device_mappings": [
42 {
43 "device_name": "/dev/sda1",
44 "volume_size": "{{user `vm_volume_size`}}",
45 "volume_type": "gp2",
46 "delete_on_termination": true
47 }
48 ],
Hung-Wei Chiu9708ed82021-04-14 14:20:08 -070049 "user_data_file": "{{user `cloud_user_data`}}"
50 }
51 ],
52 "provisioners": [
53 {
54 "type": "shell-local",
Jan Klareda5079e2023-09-29 11:43:31 +020055 "command": "ansible-galaxy install -p {{user `ansible_roles_path`}} -r ./ansible-galaxy-requirements.yaml"
Hung-Wei Chiu9708ed82021-04-14 14:20:08 -070056 },
57 {
58 "type": "ansible",
59 "user": "{{user `ssh_user`}}",
60 "playbook_file": "provision/local-builder.yaml",
61 "ansible_env_vars": [
62 "ANSIBLE_NOCOWS=1",
63 "ANSIBLE_PIPELINING=False",
64 "ANSIBLE_HOST_KEY_CHECKING=False",
65 "ANSIBLE_ROLES_PATH={{user `ansible_roles_path`}}",
66 "ANSIBLE_CALLBACK_WHITELIST=profile_tasks",
67 "ANSIBLE_STDOUT_CALLBACK=debug"
68 ]
69 },
70 {
71 "type": "ansible",
72 "user": "{{user `ssh_user`}}",
73 "playbook_file": "./common-packer/provision/local-docker.yaml",
74 "ansible_env_vars": [
75 "ANSIBLE_NOCOWS=1",
76 "ANSIBLE_PIPELINING=False",
77 "ANSIBLE_HOST_KEY_CHECKING=False",
78 "ANSIBLE_ROLES_PATH={{user `ansible_roles_path`}}",
79 "ANSIBLE_CALLBACK_WHITELIST=profile_tasks",
80 "ANSIBLE_STDOUT_CALLBACK=debug"
81 ]
82 },
83 {
84 "type": "ansible",
85 "user": "{{user `ssh_user`}}",
86 "playbook_file": "provision/onf-playbook.yaml",
87 "ansible_env_vars": [
88 "ANSIBLE_NOCOWS=1",
89 "ANSIBLE_PIPELINING=False",
90 "ANSIBLE_HOST_KEY_CHECKING=False",
91 "ANSIBLE_ROLES_PATH={{user `ansible_roles_path`}}",
92 "ANSIBLE_CALLBACK_WHITELIST=profile_tasks",
93 "ANSIBLE_STDOUT_CALLBACK=debug"
94 ]
95 }
96 ]
97}