blob: 06280311b3b11012821e1c0b5d2f2fb9521b401b [file] [log] [blame]
Jiri Broulik4ea221c2018-04-10 13:48:06 +02001{
2 "variables": {
3 "user": "root",
4 "password": "r00tme",
azvyagintsev0f697cf2018-06-22 11:44:13 +03005 "images_cache": "{{ env `PACKER_IMAGES_CACHE` }}",
6 "disk_size": "50000",
Jiri Broulik4ea221c2018-04-10 13:48:06 +02007 "do_api_token": "{{ env `DO_API_TOKEN` }}",
8 "image_name": "{{ env `IMAGE_NAME` }}",
Jiri Broulik3ffb7452018-04-12 10:37:07 +02009 "cluster_model": "{{ env `CLUSTER_MODEL` }}",
10 "cluster_model_ref": "{{ env `CLUSTER_MODEL_REF` }}",
11 "cluster_name": "{{ env `CLUSTER_NAME` }}",
azvyagintsevffa75b42018-06-06 20:38:54 +030012 "bs_hostname": "cfg01",
Jiri Broulik3ffb7452018-04-12 10:37:07 +020013 "formula_version": "{{ env `FORMULA_VERSION` }}",
14 "mcp_version": "{{ env `MCP_VERSION` }}",
15 "ubuntu_baseurl": "{{ env `UBUNTU_BASEURL` }}",
16 "saltstack_gpg": "{{ env `SALTSTACK_GPG` }}",
17 "saltstack_repo": "{{ env `SALTSTACK_REPO` }}",
18 "apt_mirantis_gpg": "{{ env `APT_MIRANTIS_GPG` }}",
19 "apt_mirantis_salt_repo": "{{ env `APT_MIRANTIS_SALT_REPO` }}",
20 "git_salt_formulas_scripts": "{{ env `GIT_SALT_FORMULAS_SCRIPTS` }}",
21 "apt_repository": "{{ env `APT_REPOSITORY` }}",
azvyagintsev0f697cf2018-06-22 11:44:13 +030022 "apt_repository_gpg": "{{ env `APT_REPOSITORY_GPG` }}"
Jiri Broulik4ea221c2018-04-10 13:48:06 +020023
24 },
25 "provisioners": [
26 {
27 "type": "file",
28 "source": "files/root/interfaces",
29 "destination": "/root/interfaces"
30 },
31 {
32 "type": "file",
33 "source": "files/root/minion.conf",
34 "destination": "/root/minion.conf"
35 },
36 {
37 "type": "file",
38 "source": "files/tmp/bootstrap.saltstack.com.sh",
39 "destination": "/tmp/bootstrap.saltstack.com.sh"
40 },
41 {
42 "environment_vars": [
43 "CLUSTER_MODEL={{ user `cluster_model` }}",
44 "CLUSTER_MODEL_REF={{ user `cluster_model_ref` }}",
45 "CLUSTER_NAME={{ user `cluster_name` }}",
azvyagintsevffa75b42018-06-06 20:38:54 +030046 "BS_HOSTNAME={{ user `bs_hostname` }}",
Jiri Broulik4ea221c2018-04-10 13:48:06 +020047 "FORMULA_VERSION={{ user `formula_version` }}",
48 "UBUNTU_BASEURL={{ user `ubuntu_baseurl` }}",
49 "SALTSTACK_GPG={{ user `saltstack_gpg` }}",
50 "SALTSTACK_REPO={{ user `saltstack_repo` }}",
51 "APT_MIRANTIS_GPG={{ user `apt_mirantis_gpg` }}",
52 "APT_MIRANTIS_SALT_REPO={{ user `apt_mirantis_salt_repo` }}",
53 "GIT_SALT_FORMULAS_SCRIPTS={{ user `git_salt_formulas_scripts` }}",
54 "APT_REPOSITORY={{ user `apt_repository` }}",
55 "APT_REPOSITORY_GPG={{ user `apt_repository_gpg` }}",
azvyagintsev0adfe682018-06-13 16:29:40 +030056 "APT_MIRANTIS_SALT_REPO={{ user `apt_mirantis_salt_repo` }}",
57 "PACKER_OFFLINE_BUILD=true"
Jiri Broulik4ea221c2018-04-10 13:48:06 +020058 ],
59 "type": "shell",
60 "execute_command": "chmod +x {{ .Path }}; {{ .Vars }} {{ .Path }}",
Jiri Broulik4ea221c2018-04-10 13:48:06 +020061 "scripts": [
alexzdbe10382018-04-16 11:07:38 +020062 "scripts/base_set_hostname.sh",
Jiri Broulik4ea221c2018-04-10 13:48:06 +020063 "scripts/base.sh",
64 "scripts/motd.sh",
65 "scripts/network.sh",
66 "scripts/salt_bootstrap.sh",
67 "scripts/salt.sh"
68 ]
69 },
70 {
71 "type": "file",
72 "source": "files/var/maas",
73 "destination": "/var/lib/maas/.maas_login.sh"
74 },
75 {
76 "type": "file",
77 "source": "files/var/jenkins",
78 "destination": "/var/lib/jenkins/org.codefirst.SimpleThemeDecorator.xml"
79 },
80 {
81 "environment_vars": [
82 "HOME=/root",
83 "MCP_VERSION={{ user `mcp_version` }}"
84 ],
85 "type": "shell",
86 "pause_before": "10s",
87 "scripts": [
88 "scripts/security.sh",
azvyagintsevffa75b42018-06-06 20:38:54 +030089 "scripts/cleanup.sh",
azvyagintsev29410ee2018-07-12 20:02:30 +030090 "scripts/cleanup_salt.sh",
91 "scripts/cleanup_day01.sh",
azvyagintsev1726e802018-06-15 16:55:44 +030092 "scripts/info.sh",
93 "scripts/zerodisk.sh"
Jiri Broulik4ea221c2018-04-10 13:48:06 +020094 ]
95 },
96 {
97 "type": "file",
98 "source": "files/etc/cloud/cloud.cfg.d/99_tcp.cfg",
99 "destination": "/etc/cloud/cloud.cfg.d/99_tcp.cfg"
100 },
101 {
102 "type": "file",
103 "source": "files/etc/cloud/cloud.cfg",
104 "destination": "/etc/cloud/cloud.cfg"
105 }
106 ],
107 "builders": [
108 {
109 "type": "qemu",
110 "qemuargs": [
111 [
112 "-m",
113 "8096M"
114 ],
115 [
116 "-fda",
117 "config-drive/cloudata.iso"
118 ],
119 [
120 "-smp",
121 "4"
122 ]
123 ],
124 "vm_name": "{{ user `image_name` }}-{{ isotime \"200601021504\" }}",
Jiri Broulikb59b1542018-04-10 18:33:28 +0200125 "output_directory": "images/{{ user `image_name` }}-qemu-{{ isotime \"200601021504\" }}",
Jiri Broulik4ea221c2018-04-10 13:48:06 +0200126 "format": "qcow2",
azvyagintsev0adfe682018-06-13 16:29:40 +0300127 "disk_compression": true,
Jiri Broulik2c75a202018-04-10 15:05:38 +0200128 "iso_checksum": "566efef1d6f12e7d3a994c2405bdb642",
129 "iso_checksum_type": "md5",
130 "iso_url": "http://cloud-images.ubuntu.com/releases/xenial/release-20180306/ubuntu-16.04-server-cloudimg-amd64-disk1.img",
azvyagintsev0f697cf2018-06-22 11:44:13 +0300131 "iso_target_path": "{{ user `images_cache`}}/release-20180306_xenial-server-cloudimg-amd64-disk1.img",
Jiri Broulik2c75a202018-04-10 15:05:38 +0200132 "disk_image": true,
Jiri Broulik4ea221c2018-04-10 13:48:06 +0200133 "accelerator": "kvm",
134 "disk_size": "{{ user `disk_size`}}",
Jiri Broulik4ea221c2018-04-10 13:48:06 +0200135 "headless": true,
136 "ssh_username": "{{user `user`}}",
137 "ssh_password": "{{user `password`}}",
azvyagintsev0adfe682018-06-13 16:29:40 +0300138 "ssh_host_port_min": 7000,
139 "ssh_host_port_max": 7050,
azvyagintsevdd137842018-07-13 18:13:06 +0300140 "shutdown_command": "shutdown -P now",
Jiri Broulik4ea221c2018-04-10 13:48:06 +0200141 "boot_wait": "2s",
142 "ssh_wait_timeout": "360s"
143 }
144 ]
145}