Add plastic release job
[releng/builder.git] / packer / templates / kubernetes.json
1 {
2   "variables": {
3     "ansible_roles_path": "roles/coe",
4     "arch": "x86_64",
5     "base_image": null,
6     "cloud_network": null,
7     "cloud_user_data": null,
8     "cloud_region": "ca-ymq-1",
9     "cloud_availability_zone": "ca-ymq-2",
10     "vm_use_block_storage": "true",
11     "vm_volume_size": "20",
12     "vm_image_disk_format": "",
13     "distro": null,
14     "flavor": "v2-highcpu-1",
15     "ssh_user": null,
16     "ssh_proxy_host": ""
17   },
18   "builders": [
19     {
20       "name": "vexxhost",
21       "image_name": "ZZCI - {{user `distro`}} - kubernetes - {{user `arch`}} - {{isotime \"20060102-150405.000\"}}",
22       "instance_name": "{{user `distro`}}-kubernetes-{{uuid}}",
23       "source_image_name": "{{user `base_image`}}",
24       "type": "openstack",
25       "region": "ca-ymq-1",
26       "availability_zone": "ca-ymq-2",
27       "networks": [
28         "{{user `cloud_network`}}"
29       ],
30       "user_data_file": "{{user `cloud_user_data`}}",
31       "ssh_username": "{{user `ssh_user`}}",
32       "ssh_proxy_host": "{{user `ssh_proxy_host`}}",
33       "flavor": "v1-standard-1",
34       "metadata": {
35         "ci_managed": "yes"
36       }
37     }
38   ],
39   "provisioners": [
40     {
41       "type": "shell",
42       "scripts": [
43         "common-packer/provision/install-python.sh"
44       ],
45       "execute_command": "chmod +x {{ .Path }}; if [ \"$UID\" == \"0\" ]; then {{ .Vars }} '{{ .Path }}'; else {{ .Vars }} sudo -E '{{ .Path }}'; fi"
46     },
47     {
48       "type": "shell-local",
49       "command": "./common-packer/ansible-galaxy.sh {{user `ansible_roles_path`}} provision/roles/coe/requirements.yaml"
50     },
51     {
52       "type": "ansible",
53       "playbook_file": "provision/kubernetes.yaml",
54       "ansible_env_vars": [
55         "ANSIBLE_NOCOWS=1",
56         "ANSIBLE_PIPELINING=True",
57         "ANSIBLE_ROLES_PATH={{user `ansible_roles_path`}}",
58         "ANSIBLE_CALLBACK_WHITELIST=profile_tasks",
59         "ANSIBLE_STDOUT_CALLBACK=debug"
60       ]
61     }
62   ]
63 }