blob: 4db83f2d05d0fde1d0fcadd113dc5d6d9540ea2f [file] [log] [blame]
Jiri Broulik4ea221c2018-04-10 13:48:06 +02001{
2 "variables": {
3 "user": "root",
4 "password": "r00tme",
5 "do_api_token": "{{ env `DO_API_TOKEN` }}",
6 "image_name": "{{ env `IMAGE_NAME` }}",
Jiri Broulik3ffb7452018-04-12 10:37:07 +02007 "cluster_model": "{{ env `CLUSTER_MODEL` }}",
8 "cluster_model_ref": "{{ env `CLUSTER_MODEL_REF` }}",
9 "cluster_name": "{{ env `CLUSTER_NAME` }}",
azvyagintsevffa75b42018-06-06 20:38:54 +030010 "bs_hostname": "cfg01",
Jiri Broulik3ffb7452018-04-12 10:37:07 +020011 "formula_version": "{{ env `FORMULA_VERSION` }}",
12 "mcp_version": "{{ env `MCP_VERSION` }}",
13 "ubuntu_baseurl": "{{ env `UBUNTU_BASEURL` }}",
14 "saltstack_gpg": "{{ env `SALTSTACK_GPG` }}",
15 "saltstack_repo": "{{ env `SALTSTACK_REPO` }}",
16 "apt_mirantis_gpg": "{{ env `APT_MIRANTIS_GPG` }}",
17 "apt_mirantis_salt_repo": "{{ env `APT_MIRANTIS_SALT_REPO` }}",
18 "git_salt_formulas_scripts": "{{ env `GIT_SALT_FORMULAS_SCRIPTS` }}",
19 "apt_repository": "{{ env `APT_REPOSITORY` }}",
20 "apt_repository_gpg": "{{ env `APT_REPOSITORY_GPG` }}",
Jiri Broulik0b211672018-04-11 09:35:47 +020021 "disk_size": "50000"
Jiri Broulik4ea221c2018-04-10 13:48:06 +020022
23 },
24 "provisioners": [
25 {
26 "type": "file",
27 "source": "files/root/interfaces",
28 "destination": "/root/interfaces"
29 },
30 {
31 "type": "file",
32 "source": "files/root/minion.conf",
33 "destination": "/root/minion.conf"
34 },
35 {
36 "type": "file",
37 "source": "files/tmp/bootstrap.saltstack.com.sh",
38 "destination": "/tmp/bootstrap.saltstack.com.sh"
39 },
40 {
41 "environment_vars": [
42 "CLUSTER_MODEL={{ user `cluster_model` }}",
43 "CLUSTER_MODEL_REF={{ user `cluster_model_ref` }}",
44 "CLUSTER_NAME={{ user `cluster_name` }}",
azvyagintsevffa75b42018-06-06 20:38:54 +030045 "BS_HOSTNAME={{ user `bs_hostname` }}",
Jiri Broulik4ea221c2018-04-10 13:48:06 +020046 "FORMULA_VERSION={{ user `formula_version` }}",
47 "UBUNTU_BASEURL={{ user `ubuntu_baseurl` }}",
48 "SALTSTACK_GPG={{ user `saltstack_gpg` }}",
49 "SALTSTACK_REPO={{ user `saltstack_repo` }}",
50 "APT_MIRANTIS_GPG={{ user `apt_mirantis_gpg` }}",
51 "APT_MIRANTIS_SALT_REPO={{ user `apt_mirantis_salt_repo` }}",
52 "GIT_SALT_FORMULAS_SCRIPTS={{ user `git_salt_formulas_scripts` }}",
53 "APT_REPOSITORY={{ user `apt_repository` }}",
54 "APT_REPOSITORY_GPG={{ user `apt_repository_gpg` }}",
azvyagintsev0adfe682018-06-13 16:29:40 +030055 "APT_MIRANTIS_SALT_REPO={{ user `apt_mirantis_salt_repo` }}",
56 "PACKER_OFFLINE_BUILD=true"
Jiri Broulik4ea221c2018-04-10 13:48:06 +020057 ],
58 "type": "shell",
59 "execute_command": "chmod +x {{ .Path }}; {{ .Vars }} {{ .Path }}",
Jiri Broulik4ea221c2018-04-10 13:48:06 +020060 "scripts": [
alexzdbe10382018-04-16 11:07:38 +020061 "scripts/base_set_hostname.sh",
Jiri Broulik4ea221c2018-04-10 13:48:06 +020062 "scripts/base.sh",
63 "scripts/motd.sh",
64 "scripts/network.sh",
65 "scripts/salt_bootstrap.sh",
66 "scripts/salt.sh"
67 ]
68 },
69 {
70 "type": "file",
71 "source": "files/var/maas",
72 "destination": "/var/lib/maas/.maas_login.sh"
73 },
74 {
75 "type": "file",
76 "source": "files/var/jenkins",
77 "destination": "/var/lib/jenkins/org.codefirst.SimpleThemeDecorator.xml"
78 },
79 {
80 "environment_vars": [
81 "HOME=/root",
82 "MCP_VERSION={{ user `mcp_version` }}"
83 ],
84 "type": "shell",
85 "pause_before": "10s",
86 "scripts": [
87 "scripts/security.sh",
azvyagintsevffa75b42018-06-06 20:38:54 +030088 "scripts/cleanup.sh",
89 "scripts/info.sh"
Jiri Broulik4ea221c2018-04-10 13:48:06 +020090 ]
91 },
92 {
93 "type": "file",
94 "source": "files/etc/cloud/cloud.cfg.d/99_tcp.cfg",
95 "destination": "/etc/cloud/cloud.cfg.d/99_tcp.cfg"
96 },
97 {
98 "type": "file",
99 "source": "files/etc/cloud/cloud.cfg",
100 "destination": "/etc/cloud/cloud.cfg"
101 }
102 ],
103 "builders": [
104 {
105 "type": "qemu",
106 "qemuargs": [
107 [
108 "-m",
109 "8096M"
110 ],
111 [
112 "-fda",
113 "config-drive/cloudata.iso"
114 ],
115 [
116 "-smp",
117 "4"
118 ]
119 ],
120 "vm_name": "{{ user `image_name` }}-{{ isotime \"200601021504\" }}",
Jiri Broulikb59b1542018-04-10 18:33:28 +0200121 "output_directory": "images/{{ user `image_name` }}-qemu-{{ isotime \"200601021504\" }}",
Jiri Broulik4ea221c2018-04-10 13:48:06 +0200122 "format": "qcow2",
azvyagintsev0adfe682018-06-13 16:29:40 +0300123 "disk_compression": true,
Jiri Broulik2c75a202018-04-10 15:05:38 +0200124 "iso_checksum": "566efef1d6f12e7d3a994c2405bdb642",
125 "iso_checksum_type": "md5",
126 "iso_url": "http://cloud-images.ubuntu.com/releases/xenial/release-20180306/ubuntu-16.04-server-cloudimg-amd64-disk1.img",
127 "disk_image": true,
Jiri Broulik4ea221c2018-04-10 13:48:06 +0200128 "accelerator": "kvm",
129 "disk_size": "{{ user `disk_size`}}",
Jiri Broulik4ea221c2018-04-10 13:48:06 +0200130 "headless": true,
131 "ssh_username": "{{user `user`}}",
132 "ssh_password": "{{user `password`}}",
azvyagintsev0adfe682018-06-13 16:29:40 +0300133 "ssh_host_port_min": 7000,
134 "ssh_host_port_max": 7050,
Jiri Broulik2c75a202018-04-10 15:05:38 +0200135 "shutdown_command": "shutdown -P now",
Jiri Broulik4ea221c2018-04-10 13:48:06 +0200136 "boot_wait": "2s",
137 "ssh_wait_timeout": "360s"
138 }
139 ]
140}