blob: 0cee60bd463435e9cd62673514723ac8acc499ac [file] [log] [blame]
Ivan Berezovskiyc46e7c02018-10-29 18:22:09 +04001{
2 "variables": {
3 "user": "root",
4 "password": "r00tme",
5 "images_cache": "{{ env `PACKER_IMAGES_CACHE` }}",
6 "disk_size": "50000",
7 "do_api_token": "{{ env `DO_API_TOKEN` }}",
8 "image_name": "{{ env `IMAGE_NAME` }}",
9 "cluster_model": "{{ env `CLUSTER_MODEL` }}",
10 "cluster_model_ref": "{{ env `CLUSTER_MODEL_REF` }}",
11 "cluster_name": "{{ env `CLUSTER_NAME` }}",
12 "bs_hostname": "cfg01",
Ivan Berezovskiyc46e7c02018-10-29 18:22:09 +040013 "mcp_version": "{{ env `MCP_VERSION` }}",
14 "ubuntu_baseurl": "{{ env `UBUNTU_BASEURL` }}",
15 "saltstack_gpg": "{{ env `SALTSTACK_GPG` }}",
16 "saltstack_repo": "{{ env `SALTSTACK_REPO` }}",
Ivan Berezovskiy7630eaf2018-12-17 16:33:14 +040017 "apt_mirantis_gpg": "{{ env `APT_MIRANTIS_SALT_GPG` }}",
Ivan Berezovskiyc46e7c02018-10-29 18:22:09 +040018 "apt_mirantis_salt_repo": "{{ env `APT_MIRANTIS_SALT_REPO` }}",
Ivan Berezovskiy038f6b62018-12-14 14:12:23 +040019 "git_salt_formulas_scripts": "{{ env `GIT_SALT_FORMULAS_SCRIPTS` }}"
Ivan Berezovskiyc46e7c02018-10-29 18:22:09 +040020 },
21 "provisioners": [
22 {
23 "type": "file",
24 "source": "files/root/",
25 "destination": "/root"
26 },
27 {
28 "type": "file",
29 "source": "files/opt/bootstrap.saltstack.com.sh",
30 "destination": "/opt/bootstrap.saltstack.com.sh"
31 },
32 {
Denis Egorenko88f1cf52019-05-24 11:04:01 +040033 "type": "file",
34 "source": "files/opt/add_keycloak_service_user.sh",
35 "destination": "/opt/add_keycloak_service_user.sh"
36 },
37 {
Ivan Berezovskiyc46e7c02018-10-29 18:22:09 +040038 "environment_vars": [
39 "UBUNTU_BASEURL={{ user `ubuntu_baseurl` }}",
40 "PACKER_OFFLINE_BUILD=true"
41 ],
42 "type": "shell",
43 "execute_command": "chmod +x {{ .Path }}; {{ .Vars }} {{ .Path }}",
44 "expect_disconnect": "true",
45 "scripts": [
46 "scripts/base_set_hostname.sh",
47 "scripts/base.sh",
48 "scripts/motd.sh",
49 "scripts/network.sh",
50 "scripts/reboot.sh"
51 ]
52 },
53 {
54 "environment_vars": [
55 "CLUSTER_MODEL={{ user `cluster_model` }}",
56 "CLUSTER_MODEL_REF={{ user `cluster_model_ref` }}",
57 "CLUSTER_NAME={{ user `cluster_name` }}",
58 "BS_HOSTNAME={{ user `bs_hostname` }}",
Ivan Berezovskiyc46e7c02018-10-29 18:22:09 +040059 "SALTSTACK_GPG={{ user `saltstack_gpg` }}",
60 "SALTSTACK_REPO={{ user `saltstack_repo` }}",
Ivan Berezovskiy7630eaf2018-12-17 16:33:14 +040061 "APT_MIRANTIS_SALT_GPG={{ user `apt_mirantis_gpg` }}",
Ivan Berezovskiyc46e7c02018-10-29 18:22:09 +040062 "APT_MIRANTIS_SALT_REPO={{ user `apt_mirantis_salt_repo` }}",
63 "GIT_SALT_FORMULAS_SCRIPTS={{ user `git_salt_formulas_scripts` }}",
Ivan Berezovskiyc46e7c02018-10-29 18:22:09 +040064 "APT_MIRANTIS_SALT_REPO={{ user `apt_mirantis_salt_repo` }}",
65 "BOOTSTRAP_SALTSTACK_COM=file:///opt/bootstrap.saltstack.com.sh",
Ivan Berezovskiy23035a22018-11-14 13:25:51 +040066 "MCP_VERSION={{ user `mcp_version` }}",
Ivan Berezovskiyc46e7c02018-10-29 18:22:09 +040067 "PACKER_OFFLINE_BUILD=true"
68 ],
69 "type": "shell",
70 "pause_before": "60s",
71 "execute_command": "chmod +x {{ .Path }}; {{ .Vars }} {{ .Path }}",
72 "expect_disconnect": "true",
73 "scripts": [
74 "scripts/salt_bootstrap.sh",
75 "scripts/salt.sh"
76 ]
77 },
78 {
Ivan Berezovskiyc46e7c02018-10-29 18:22:09 +040079 "type": "shell",
80 "pause_before": "10s",
81 "scripts": [
82 "scripts/security.sh",
83 "scripts/info.sh",
84 "scripts/zerodisk.sh"
85 ]
86 },
87 {
88 "type": "file",
89 "source": "files/etc/",
90 "destination": "/etc"
91 }
92 ],
93 "builders": [
94 {
95 "type": "qemu",
96 "qemuargs": [
97 [
98 "-m",
99 "8096M"
100 ],
101 [
Ivan Berezovskiy23035a22018-11-14 13:25:51 +0400102 "-cdrom",
Ivan Berezovskiyc46e7c02018-10-29 18:22:09 +0400103 "config-drive/cloudata.iso"
104 ],
105 [
106 "-smp",
107 "4"
108 ]
109 ],
Aleksey Zvyagintsev42e76952018-12-14 13:40:44 +0000110 "vm_name": "{{ user `image_name` }}-{{ isotime \"200601021504\" }}.qcow2",
Ivan Berezovskiyc46e7c02018-10-29 18:22:09 +0400111 "output_directory": "images/{{ user `image_name` }}-qemu-{{ isotime \"200601021504\" }}",
Ivan Berezovskiyc46e7c02018-10-29 18:22:09 +0400112 "disk_compression": true,
Aleksey Zvyagintsev42e76952018-12-14 13:40:44 +0000113 "disk_size": "{{ user `disk_size`}}",
114 "format": "qcow2",
Ivan Berezovskiyc46e7c02018-10-29 18:22:09 +0400115 "iso_checksum": "566efef1d6f12e7d3a994c2405bdb642",
116 "iso_checksum_type": "md5",
117 "iso_url": "http://cloud-images.ubuntu.com/releases/xenial/release-20180306/ubuntu-16.04-server-cloudimg-amd64-disk1.img",
118 "iso_target_path": "{{ user `images_cache`}}/release-20180306_xenial-server-cloudimg-amd64-disk1.img",
119 "disk_image": true,
120 "accelerator": "kvm",
Ivan Berezovskiyc46e7c02018-10-29 18:22:09 +0400121 "headless": true,
122 "ssh_username": "{{user `user`}}",
123 "ssh_password": "{{user `password`}}",
124 "ssh_host_port_min": 7000,
125 "ssh_host_port_max": 7050,
126 "shutdown_command": "shutdown -P now",
127 "boot_wait": "2s",
128 "ssh_wait_timeout": "360s"
129 }
130 ]
Aleksey Zvyagintsev42e76952018-12-14 13:40:44 +0000131}