blob: b1a7171a622585053d2ed0ba56ee2a3fa4f995e9 [file] [log] [blame]
Richard Felkld59c5652018-02-08 13:14:05 +01001{
2 "variables": {
3 "user": "root",
azvyagintsev6d453852018-02-26 16:56:37 +02004 "password": "r00tme",
Richard Felkld59c5652018-02-08 13:14:05 +01005 "do_api_token": "{{ env `DO_API_TOKEN` }}",
azvyagintsev6d453852018-02-26 16:56:37 +02006 "image_name": "{{ env `IMAGE_NAME` }}",
7 "VM_IMAGE": "{{ env `VM_IMAGE` }}",
8 "floating_ip_pool": "{{ env `VM_FLOATING_IP_POOL` }}",
azvyagintsevc86fbaf2018-03-02 18:57:03 +02009 "VM_FLAVOR": "{{ env `VM_FLAVOR` }}",
Richard Felkld59c5652018-02-08 13:14:05 +010010 "disk_size": "150000",
11 "cluster_model": "{{ env `CLUSTER_MODEL` }}",
12 "cluster_model_ref": "{{ env `CLUSTER_MODEL_REF` }}",
13 "cluster_name": "{{ env `CLUSTER_NAME` }}",
14 "formula_version": "{{ env `FORMULA_VERSION` }}",
azvyagintsev6d453852018-02-26 16:56:37 +020015 "mcp_version": "{{ env `MCP_VERSION` }}",
16 "ubuntu_baseurl": "{{ env `UBUNTU_BASEURL` }}",
17 "saltstack_gpg": "{{ env `SALTSTACK_GPG` }}",
18 "saltstack_repo": "{{ env `SALTSTACK_REPO` }}",
19 "apt_mirantis_gpg": "{{ env `APT_MIRANTIS_GPG` }}",
20 "apt_mirantis_salt_repo": "{{ env `APT_MIRANTIS_SALT_REPO` }}",
21 "git_salt_formulas_scripts": "{{ env `GIT_SALT_FORMULAS_SCRIPTS` }}",
22 "apt_repository": "{{ env `APT_REPOSITORY` }}",
23 "apt_repository_gpg": "{{ env `APT_REPOSITORY_GPG` }}"
Richard Felkld59c5652018-02-08 13:14:05 +010024 },
25 "provisioners": [
26 {
azvyagintsev6d453852018-02-26 16:56:37 +020027 "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 {
azvyagintsevc86fbaf2018-03-02 18:57:03 +020037 "type": "file",
38 "source": "files/tmp/bootstrap.saltstack.com.sh",
39 "destination": "/tmp/bootstrap.saltstack.com.sh"
40 },
41 {
Richard Felkld59c5652018-02-08 13:14:05 +010042 "environment_vars": [
43 "CLUSTER_MODEL={{ user `cluster_model` }}",
44 "CLUSTER_MODEL_REF={{ user `cluster_model_ref` }}",
45 "CLUSTER_NAME={{ user `cluster_name` }}",
azvyagintsev6d453852018-02-26 16:56:37 +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` }}",
55 "PACKER_OFFLINE_BUILD=true"
Richard Felkld59c5652018-02-08 13:14:05 +010056 ],
57 "type": "shell",
58 "expect_disconnect": "true",
azvyagintsevc86fbaf2018-03-02 18:57:03 +020059 "scripts": [
60 "scripts/base.sh",
61 "scripts/network.sh",
62 "scripts/salt_bootstrap.sh"
63 ]
Richard Felkld59c5652018-02-08 13:14:05 +010064 },
65 {
azvyagintsev6d453852018-02-26 16:56:37 +020066 "environment_vars": [
67 "APT_MIRANTIS_SALT_REPO={{ user `apt_mirantis_salt_repo` }}"
68 ],
Richard Felkld59c5652018-02-08 13:14:05 +010069 "type": "shell",
70 "expect_disconnect": "true",
azvyagintsevc86fbaf2018-03-02 18:57:03 +020071 "scripts": [
72 "scripts/salt.sh"
73 ]
Richard Felkld59c5652018-02-08 13:14:05 +010074 },
75 {
76 "environment_vars": [
77 "HOME=/root",
78 "MCP_VERSION={{ user `mcp_version` }}"
79 ],
80 "type": "shell",
azvyagintsevc86fbaf2018-03-02 18:57:03 +020081 "pause_before": "120s",
82 "scripts": [
83 "scripts/mirrors.sh",
84 "scripts/security.sh",
85 "scripts/cleanup.sh"
86 ]
Richard Felkld59c5652018-02-08 13:14:05 +010087 },
88 {
89 "type": "file",
azvyagintsev6d453852018-02-26 16:56:37 +020090 "source": "files/etc/cloud/cloud.cfg.d/99_tcp.cfg",
Richard Felkld59c5652018-02-08 13:14:05 +010091 "destination": "/etc/cloud/cloud.cfg.d/99_tcp.cfg"
92 },
93 {
94 "type": "file",
azvyagintsev6d453852018-02-26 16:56:37 +020095 "source": "files/etc/cloud/cloud.cfg",
Richard Felkld59c5652018-02-08 13:14:05 +010096 "destination": "/etc/cloud/cloud.cfg"
97 }
98 ],
99 "builders": [
100 {
azvyagintsev6d453852018-02-26 16:56:37 +0200101 "type": "openstack",
102 "ssh_username": "{{user `user`}}",
103 "ssh_password": "{{user `password`}}",
104 "image_name": "{{user `image_name`}}",
105 "floating_ip_pool": "{{user `floating_ip_pool`}}",
azvyagintsevc86fbaf2018-03-02 18:57:03 +0200106 "reuse_ips": "true",
azvyagintsev6d453852018-02-26 16:56:37 +0200107 "security_groups": [
108 "open_all"
109 ],
110 "source_image": "{{ user `VM_IMAGE` }}",
111 "flavor": "{{ user `VM_FLAVOR` }}",
112 "user_data_file": "config-drive/user-data.yaml"
113 },
114 {
Richard Felkld59c5652018-02-08 13:14:05 +0100115 "type": "qemu",
116 "qemuargs": [
117 [
118 "-m",
azvyagintsev6d453852018-02-26 16:56:37 +0200119 "8096M"
120 ],
121 [
122 "-fda",
123 "config-drive/cloudata.iso"
Richard Felkld59c5652018-02-08 13:14:05 +0100124 ],
125 [
126 "-smp",
127 "4"
128 ]
129 ],
azvyagintsev6d453852018-02-26 16:56:37 +0200130 "vm_name": "{{ user `image_name` }}-{{ isotime \"200601021504\" }}",
131 "output_directory": "images/{{ user `image_name`}}",
Richard Felkld59c5652018-02-08 13:14:05 +0100132 "format": "qcow2",
133 "accelerator": "kvm",
134 "disk_size": "{{ user `disk_size`}}",
azvyagintsev6d453852018-02-26 16:56:37 +0200135 "iso_url": "http://cloud-images.ubuntu.com/xenial/20180224/xenial-server-cloudimg-amd64-disk1.img",
136 "iso_target_path": "/root/isos/xenial-server-cloudimg-amd64-disk1.img",
Richard Felkld59c5652018-02-08 13:14:05 +0100137 "iso_checksum_type": "md5",
azvyagintsev6d453852018-02-26 16:56:37 +0200138 "disk_image": true,
139 "iso_checksum": "697d8f9058ad118cea699d14ae414f8b",
Richard Felkld59c5652018-02-08 13:14:05 +0100140 "http_directory": "http",
141 "headless": true,
142 "ssh_username": "{{user `user`}}",
143 "ssh_password": "{{user `password`}}",
azvyagintsev6d453852018-02-26 16:56:37 +0200144 "shutdown_command": "sync; shutdown -P now",
145 "vnc_bind_address": "0.0.0.0",
146 "vnc_port_max": "5956",
147 "vnc_port_min": "5956",
148 "ssh_host_port_min": 2223,
149 "ssh_host_port_max": 2223,
Richard Felkld59c5652018-02-08 13:14:05 +0100150 "boot_wait": "2s",
azvyagintsev6d453852018-02-26 16:56:37 +0200151 "ssh_wait_timeout": "360s"
Richard Felkld59c5652018-02-08 13:14:05 +0100152 }
153 ]
azvyagintsev6d453852018-02-26 16:56:37 +0200154}