Jiri Broulik | 4ea221c | 2018-04-10 13:48:06 +0200 | [diff] [blame] | 1 | { |
| 2 | "variables": { |
| 3 | "user": "root", |
| 4 | "password": "r00tme", |
| 5 | "do_api_token": "{{ env `DO_API_TOKEN` }}", |
| 6 | "image_name": "{{ env `IMAGE_NAME` }}", |
Jiri Broulik | 3ffb745 | 2018-04-12 10:37:07 +0200 | [diff] [blame] | 7 | "cluster_model": "{{ env `CLUSTER_MODEL` }}", |
| 8 | "cluster_model_ref": "{{ env `CLUSTER_MODEL_REF` }}", |
| 9 | "cluster_name": "{{ env `CLUSTER_NAME` }}", |
azvyagintsev | ffa75b4 | 2018-06-06 20:38:54 +0300 | [diff] [blame^] | 10 | "bs_hostname": "cfg01", |
Jiri Broulik | 3ffb745 | 2018-04-12 10:37:07 +0200 | [diff] [blame] | 11 | "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 Broulik | 0b21167 | 2018-04-11 09:35:47 +0200 | [diff] [blame] | 21 | "disk_size": "50000" |
Jiri Broulik | 4ea221c | 2018-04-10 13:48:06 +0200 | [diff] [blame] | 22 | |
| 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` }}", |
azvyagintsev | ffa75b4 | 2018-06-06 20:38:54 +0300 | [diff] [blame^] | 45 | "BS_HOSTNAME={{ user `bs_hostname` }}", |
Jiri Broulik | 4ea221c | 2018-04-10 13:48:06 +0200 | [diff] [blame] | 46 | "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 | "APT_MIRANTIS_SALT_REPO={{ user `apt_mirantis_salt_repo` }}" |
| 56 | ], |
| 57 | "type": "shell", |
| 58 | "execute_command": "chmod +x {{ .Path }}; {{ .Vars }} {{ .Path }}", |
Jiri Broulik | 4ea221c | 2018-04-10 13:48:06 +0200 | [diff] [blame] | 59 | "scripts": [ |
alexz | dbe1038 | 2018-04-16 11:07:38 +0200 | [diff] [blame] | 60 | "scripts/base_set_hostname.sh", |
Jiri Broulik | 4ea221c | 2018-04-10 13:48:06 +0200 | [diff] [blame] | 61 | "scripts/base.sh", |
| 62 | "scripts/motd.sh", |
| 63 | "scripts/network.sh", |
| 64 | "scripts/salt_bootstrap.sh", |
| 65 | "scripts/salt.sh" |
| 66 | ] |
| 67 | }, |
| 68 | { |
| 69 | "type": "file", |
| 70 | "source": "files/var/maas", |
| 71 | "destination": "/var/lib/maas/.maas_login.sh" |
| 72 | }, |
| 73 | { |
| 74 | "type": "file", |
| 75 | "source": "files/var/jenkins", |
| 76 | "destination": "/var/lib/jenkins/org.codefirst.SimpleThemeDecorator.xml" |
| 77 | }, |
| 78 | { |
| 79 | "environment_vars": [ |
| 80 | "HOME=/root", |
| 81 | "MCP_VERSION={{ user `mcp_version` }}" |
| 82 | ], |
| 83 | "type": "shell", |
| 84 | "pause_before": "10s", |
| 85 | "scripts": [ |
| 86 | "scripts/security.sh", |
azvyagintsev | ffa75b4 | 2018-06-06 20:38:54 +0300 | [diff] [blame^] | 87 | "scripts/cleanup.sh", |
| 88 | "scripts/info.sh" |
Jiri Broulik | 4ea221c | 2018-04-10 13:48:06 +0200 | [diff] [blame] | 89 | ] |
| 90 | }, |
| 91 | { |
| 92 | "type": "file", |
| 93 | "source": "files/etc/cloud/cloud.cfg.d/99_tcp.cfg", |
| 94 | "destination": "/etc/cloud/cloud.cfg.d/99_tcp.cfg" |
| 95 | }, |
| 96 | { |
| 97 | "type": "file", |
| 98 | "source": "files/etc/cloud/cloud.cfg", |
| 99 | "destination": "/etc/cloud/cloud.cfg" |
| 100 | } |
| 101 | ], |
| 102 | "builders": [ |
| 103 | { |
| 104 | "type": "qemu", |
| 105 | "qemuargs": [ |
| 106 | [ |
| 107 | "-m", |
| 108 | "8096M" |
| 109 | ], |
| 110 | [ |
| 111 | "-fda", |
| 112 | "config-drive/cloudata.iso" |
| 113 | ], |
| 114 | [ |
| 115 | "-smp", |
| 116 | "4" |
| 117 | ] |
| 118 | ], |
| 119 | "vm_name": "{{ user `image_name` }}-{{ isotime \"200601021504\" }}", |
Jiri Broulik | b59b154 | 2018-04-10 18:33:28 +0200 | [diff] [blame] | 120 | "output_directory": "images/{{ user `image_name` }}-qemu-{{ isotime \"200601021504\" }}", |
Jiri Broulik | 4ea221c | 2018-04-10 13:48:06 +0200 | [diff] [blame] | 121 | "format": "qcow2", |
Jiri Broulik | 2c75a20 | 2018-04-10 15:05:38 +0200 | [diff] [blame] | 122 | "iso_checksum": "566efef1d6f12e7d3a994c2405bdb642", |
| 123 | "iso_checksum_type": "md5", |
| 124 | "iso_url": "http://cloud-images.ubuntu.com/releases/xenial/release-20180306/ubuntu-16.04-server-cloudimg-amd64-disk1.img", |
| 125 | "disk_image": true, |
Jiri Broulik | 4ea221c | 2018-04-10 13:48:06 +0200 | [diff] [blame] | 126 | "accelerator": "kvm", |
| 127 | "disk_size": "{{ user `disk_size`}}", |
Jiri Broulik | 4ea221c | 2018-04-10 13:48:06 +0200 | [diff] [blame] | 128 | "headless": true, |
| 129 | "ssh_username": "{{user `user`}}", |
| 130 | "ssh_password": "{{user `password`}}", |
Jiri Broulik | 2c75a20 | 2018-04-10 15:05:38 +0200 | [diff] [blame] | 131 | "shutdown_command": "shutdown -P now", |
Jiri Broulik | 4ea221c | 2018-04-10 13:48:06 +0200 | [diff] [blame] | 132 | "boot_wait": "2s", |
| 133 | "ssh_wait_timeout": "360s" |
| 134 | } |
| 135 | ] |
| 136 | } |