Ivan Berezovskiy | c46e7c0 | 2018-10-29 18:22:09 +0400 | [diff] [blame] | 1 | { |
| 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 Berezovskiy | c46e7c0 | 2018-10-29 18:22:09 +0400 | [diff] [blame] | 13 | "mcp_version": "{{ env `MCP_VERSION` }}", |
| 14 | "ubuntu_baseurl": "{{ env `UBUNTU_BASEURL` }}", |
| 15 | "saltstack_gpg": "{{ env `SALTSTACK_GPG` }}", |
| 16 | "saltstack_repo": "{{ env `SALTSTACK_REPO` }}", |
Ivan Berezovskiy | 7630eaf | 2018-12-17 16:33:14 +0400 | [diff] [blame] | 17 | "apt_mirantis_gpg": "{{ env `APT_MIRANTIS_SALT_GPG` }}", |
Ivan Berezovskiy | c46e7c0 | 2018-10-29 18:22:09 +0400 | [diff] [blame] | 18 | "apt_mirantis_salt_repo": "{{ env `APT_MIRANTIS_SALT_REPO` }}", |
Ivan Berezovskiy | 038f6b6 | 2018-12-14 14:12:23 +0400 | [diff] [blame] | 19 | "git_salt_formulas_scripts": "{{ env `GIT_SALT_FORMULAS_SCRIPTS` }}" |
Ivan Berezovskiy | c46e7c0 | 2018-10-29 18:22:09 +0400 | [diff] [blame] | 20 | }, |
| 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 Egorenko | 88f1cf5 | 2019-05-24 11:04:01 +0400 | [diff] [blame] | 33 | "type": "file", |
| 34 | "source": "files/opt/add_keycloak_service_user.sh", |
| 35 | "destination": "/opt/add_keycloak_service_user.sh" |
| 36 | }, |
| 37 | { |
Ivan Berezovskiy | c46e7c0 | 2018-10-29 18:22:09 +0400 | [diff] [blame] | 38 | "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 Berezovskiy | c46e7c0 | 2018-10-29 18:22:09 +0400 | [diff] [blame] | 59 | "SALTSTACK_GPG={{ user `saltstack_gpg` }}", |
| 60 | "SALTSTACK_REPO={{ user `saltstack_repo` }}", |
Ivan Berezovskiy | 7630eaf | 2018-12-17 16:33:14 +0400 | [diff] [blame] | 61 | "APT_MIRANTIS_SALT_GPG={{ user `apt_mirantis_gpg` }}", |
Ivan Berezovskiy | c46e7c0 | 2018-10-29 18:22:09 +0400 | [diff] [blame] | 62 | "APT_MIRANTIS_SALT_REPO={{ user `apt_mirantis_salt_repo` }}", |
| 63 | "GIT_SALT_FORMULAS_SCRIPTS={{ user `git_salt_formulas_scripts` }}", |
Ivan Berezovskiy | c46e7c0 | 2018-10-29 18:22:09 +0400 | [diff] [blame] | 64 | "APT_MIRANTIS_SALT_REPO={{ user `apt_mirantis_salt_repo` }}", |
| 65 | "BOOTSTRAP_SALTSTACK_COM=file:///opt/bootstrap.saltstack.com.sh", |
Ivan Berezovskiy | 23035a2 | 2018-11-14 13:25:51 +0400 | [diff] [blame] | 66 | "MCP_VERSION={{ user `mcp_version` }}", |
Ivan Berezovskiy | c46e7c0 | 2018-10-29 18:22:09 +0400 | [diff] [blame] | 67 | "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 Berezovskiy | c46e7c0 | 2018-10-29 18:22:09 +0400 | [diff] [blame] | 79 | "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 Berezovskiy | 23035a2 | 2018-11-14 13:25:51 +0400 | [diff] [blame] | 102 | "-cdrom", |
Ivan Berezovskiy | c46e7c0 | 2018-10-29 18:22:09 +0400 | [diff] [blame] | 103 | "config-drive/cloudata.iso" |
| 104 | ], |
| 105 | [ |
| 106 | "-smp", |
| 107 | "4" |
| 108 | ] |
| 109 | ], |
Aleksey Zvyagintsev | 42e7695 | 2018-12-14 13:40:44 +0000 | [diff] [blame] | 110 | "vm_name": "{{ user `image_name` }}-{{ isotime \"200601021504\" }}.qcow2", |
Ivan Berezovskiy | c46e7c0 | 2018-10-29 18:22:09 +0400 | [diff] [blame] | 111 | "output_directory": "images/{{ user `image_name` }}-qemu-{{ isotime \"200601021504\" }}", |
Ivan Berezovskiy | c46e7c0 | 2018-10-29 18:22:09 +0400 | [diff] [blame] | 112 | "disk_compression": true, |
Aleksey Zvyagintsev | 42e7695 | 2018-12-14 13:40:44 +0000 | [diff] [blame] | 113 | "disk_size": "{{ user `disk_size`}}", |
| 114 | "format": "qcow2", |
Ivan Berezovskiy | c46e7c0 | 2018-10-29 18:22:09 +0400 | [diff] [blame] | 115 | "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 Berezovskiy | c46e7c0 | 2018-10-29 18:22:09 +0400 | [diff] [blame] | 121 | "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 Zvyagintsev | 42e7695 | 2018-12-14 13:40:44 +0000 | [diff] [blame] | 131 | } |