blob: 6660adbfbb9090e8c62b1dd8fed9644729d04562 [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` }}",
17 "apt_mirantis_gpg": "{{ env `APT_MIRANTIS_GPG` }}",
18 "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 {
33 "environment_vars": [
34 "UBUNTU_BASEURL={{ user `ubuntu_baseurl` }}",
35 "PACKER_OFFLINE_BUILD=true"
36 ],
37 "type": "shell",
38 "execute_command": "chmod +x {{ .Path }}; {{ .Vars }} {{ .Path }}",
39 "expect_disconnect": "true",
40 "scripts": [
41 "scripts/base_set_hostname.sh",
42 "scripts/base.sh",
43 "scripts/motd.sh",
44 "scripts/network.sh",
45 "scripts/reboot.sh"
46 ]
47 },
48 {
49 "environment_vars": [
50 "CLUSTER_MODEL={{ user `cluster_model` }}",
51 "CLUSTER_MODEL_REF={{ user `cluster_model_ref` }}",
52 "CLUSTER_NAME={{ user `cluster_name` }}",
53 "BS_HOSTNAME={{ user `bs_hostname` }}",
Ivan Berezovskiyc46e7c02018-10-29 18:22:09 +040054 "SALTSTACK_GPG={{ user `saltstack_gpg` }}",
55 "SALTSTACK_REPO={{ user `saltstack_repo` }}",
56 "APT_MIRANTIS_GPG={{ user `apt_mirantis_gpg` }}",
57 "APT_MIRANTIS_SALT_REPO={{ user `apt_mirantis_salt_repo` }}",
58 "GIT_SALT_FORMULAS_SCRIPTS={{ user `git_salt_formulas_scripts` }}",
Ivan Berezovskiyc46e7c02018-10-29 18:22:09 +040059 "APT_MIRANTIS_SALT_REPO={{ user `apt_mirantis_salt_repo` }}",
60 "BOOTSTRAP_SALTSTACK_COM=file:///opt/bootstrap.saltstack.com.sh",
Ivan Berezovskiy23035a22018-11-14 13:25:51 +040061 "MCP_VERSION={{ user `mcp_version` }}",
Ivan Berezovskiyc46e7c02018-10-29 18:22:09 +040062 "PACKER_OFFLINE_BUILD=true"
63 ],
64 "type": "shell",
65 "pause_before": "60s",
66 "execute_command": "chmod +x {{ .Path }}; {{ .Vars }} {{ .Path }}",
67 "expect_disconnect": "true",
68 "scripts": [
69 "scripts/salt_bootstrap.sh",
70 "scripts/salt.sh"
71 ]
72 },
73 {
Ivan Berezovskiyc46e7c02018-10-29 18:22:09 +040074 "type": "shell",
75 "pause_before": "10s",
76 "scripts": [
77 "scripts/security.sh",
78 "scripts/info.sh",
79 "scripts/zerodisk.sh"
80 ]
81 },
82 {
83 "type": "file",
84 "source": "files/etc/",
85 "destination": "/etc"
86 }
87 ],
88 "builders": [
89 {
90 "type": "qemu",
91 "qemuargs": [
92 [
93 "-m",
94 "8096M"
95 ],
96 [
Ivan Berezovskiy23035a22018-11-14 13:25:51 +040097 "-cdrom",
Ivan Berezovskiyc46e7c02018-10-29 18:22:09 +040098 "config-drive/cloudata.iso"
99 ],
100 [
101 "-smp",
102 "4"
103 ]
104 ],
105 "vm_name": "{{ user `image_name` }}-{{ isotime \"200601021504\" }}",
106 "output_directory": "images/{{ user `image_name` }}-qemu-{{ isotime \"200601021504\" }}",
107 "format": "qcow2",
108 "disk_compression": true,
109 "iso_checksum": "566efef1d6f12e7d3a994c2405bdb642",
110 "iso_checksum_type": "md5",
111 "iso_url": "http://cloud-images.ubuntu.com/releases/xenial/release-20180306/ubuntu-16.04-server-cloudimg-amd64-disk1.img",
112 "iso_target_path": "{{ user `images_cache`}}/release-20180306_xenial-server-cloudimg-amd64-disk1.img",
113 "disk_image": true,
114 "accelerator": "kvm",
115 "disk_size": "{{ user `disk_size`}}",
116 "headless": true,
117 "ssh_username": "{{user `user`}}",
118 "ssh_password": "{{user `password`}}",
119 "ssh_host_port_min": 7000,
120 "ssh_host_port_max": 7050,
121 "shutdown_command": "shutdown -P now",
122 "boot_wait": "2s",
123 "ssh_wait_timeout": "360s"
124 }
125 ]
Ivan Berezovskiy2e3d00f2018-12-14 13:36:46 +0000126}