blob: 668b2820624dc7cce8499c39354a8783b459fac4 [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": "",
14 "subnet_id": null,
15 "ssh_user": null
16 },
17 "builders": [
18 {
19 "name": "aws",
20 "access_key": "{{user `aws_access_key`}}",
21 "ami_name": "{{user `distro`}} - basebuild - {{user `arch`}} - {{isotime \"20060102-1504\"}}",
22 "instance_type": "{{user `instance_type`}}",
23 "region": "us-west-2",
24 "secret_key": "{{user `aws_security_key`}}",
25 "security_group_id": "{{user `security_group_id`}}",
26 "source_ami_filter": {
27 "filters": {
28 "name": "{{user `source_ami_filter_name`}}",
29 "product-code": "{{user `source_ami_filter_product_code`}}",
30 "architecture": "{{user `arch`}}",
31 "root-device-type": "ebs",
32 "virtualization-type": "hvm"
33 },
34 "most_recent": true,
35 "owners": ["{{user `source_ami_filter_owner`}}"]
36 },
37 "ssh_username": "{{user `ssh_user`}}",
38 "subnet_id": "{{user `subnet_id`}}",
39 "type": "amazon-ebs",
40 "user_data_file": "{{user `cloud_user_data`}}"
41 }
42 ],
43 "provisioners": [
44 {
45 "type": "shell-local",
46 "command": "./common-packer/ansible-galaxy.sh {{user `ansible_roles_path`}}"
47 },
48 {
49 "type": "ansible",
50 "user": "{{user `ssh_user`}}",
51 "playbook_file": "provision/local-builder.yaml",
52 "ansible_env_vars": [
53 "ANSIBLE_NOCOWS=1",
54 "ANSIBLE_PIPELINING=False",
55 "ANSIBLE_HOST_KEY_CHECKING=False",
56 "ANSIBLE_ROLES_PATH={{user `ansible_roles_path`}}",
57 "ANSIBLE_CALLBACK_WHITELIST=profile_tasks",
58 "ANSIBLE_STDOUT_CALLBACK=debug"
59 ]
60 },
61 {
62 "type": "ansible",
63 "user": "{{user `ssh_user`}}",
64 "playbook_file": "./common-packer/provision/local-docker.yaml",
65 "ansible_env_vars": [
66 "ANSIBLE_NOCOWS=1",
67 "ANSIBLE_PIPELINING=False",
68 "ANSIBLE_HOST_KEY_CHECKING=False",
69 "ANSIBLE_ROLES_PATH={{user `ansible_roles_path`}}",
70 "ANSIBLE_CALLBACK_WHITELIST=profile_tasks",
71 "ANSIBLE_STDOUT_CALLBACK=debug"
72 ]
73 },
74 {
75 "type": "ansible",
76 "user": "{{user `ssh_user`}}",
77 "playbook_file": "provision/onf-playbook.yaml",
78 "ansible_env_vars": [
79 "ANSIBLE_NOCOWS=1",
80 "ANSIBLE_PIPELINING=False",
81 "ANSIBLE_HOST_KEY_CHECKING=False",
82 "ANSIBLE_ROLES_PATH={{user `ansible_roles_path`}}",
83 "ANSIBLE_CALLBACK_WHITELIST=profile_tasks",
84 "ANSIBLE_STDOUT_CALLBACK=debug"
85 ]
86 }
87 ]
88}