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` }}", |
| 10 | "formula_version": "{{ env `FORMULA_VERSION` }}", |
| 11 | "mcp_version": "{{ env `MCP_VERSION` }}", |
| 12 | "ubuntu_baseurl": "{{ env `UBUNTU_BASEURL` }}", |
| 13 | "saltstack_gpg": "{{ env `SALTSTACK_GPG` }}", |
| 14 | "saltstack_repo": "{{ env `SALTSTACK_REPO` }}", |
| 15 | "apt_mirantis_gpg": "{{ env `APT_MIRANTIS_GPG` }}", |
| 16 | "apt_mirantis_salt_repo": "{{ env `APT_MIRANTIS_SALT_REPO` }}", |
| 17 | "git_salt_formulas_scripts": "{{ env `GIT_SALT_FORMULAS_SCRIPTS` }}", |
| 18 | "apt_repository": "{{ env `APT_REPOSITORY` }}", |
| 19 | "apt_repository_gpg": "{{ env `APT_REPOSITORY_GPG` }}", |
Jiri Broulik | 0b21167 | 2018-04-11 09:35:47 +0200 | [diff] [blame] | 20 | "disk_size": "50000" |
Jiri Broulik | 4ea221c | 2018-04-10 13:48:06 +0200 | [diff] [blame] | 21 | |
| 22 | }, |
| 23 | "provisioners": [ |
| 24 | { |
| 25 | "type": "file", |
| 26 | "source": "files/root/interfaces", |
| 27 | "destination": "/root/interfaces" |
| 28 | }, |
| 29 | { |
| 30 | "type": "file", |
| 31 | "source": "files/root/minion.conf", |
| 32 | "destination": "/root/minion.conf" |
| 33 | }, |
| 34 | { |
| 35 | "type": "file", |
| 36 | "source": "files/tmp/bootstrap.saltstack.com.sh", |
| 37 | "destination": "/tmp/bootstrap.saltstack.com.sh" |
| 38 | }, |
| 39 | { |
| 40 | "environment_vars": [ |
| 41 | "CLUSTER_MODEL={{ user `cluster_model` }}", |
| 42 | "CLUSTER_MODEL_REF={{ user `cluster_model_ref` }}", |
| 43 | "CLUSTER_NAME={{ user `cluster_name` }}", |
| 44 | "FORMULA_VERSION={{ user `formula_version` }}", |
| 45 | "UBUNTU_BASEURL={{ user `ubuntu_baseurl` }}", |
| 46 | "SALTSTACK_GPG={{ user `saltstack_gpg` }}", |
| 47 | "SALTSTACK_REPO={{ user `saltstack_repo` }}", |
| 48 | "APT_MIRANTIS_GPG={{ user `apt_mirantis_gpg` }}", |
| 49 | "APT_MIRANTIS_SALT_REPO={{ user `apt_mirantis_salt_repo` }}", |
| 50 | "GIT_SALT_FORMULAS_SCRIPTS={{ user `git_salt_formulas_scripts` }}", |
| 51 | "APT_REPOSITORY={{ user `apt_repository` }}", |
| 52 | "APT_REPOSITORY_GPG={{ user `apt_repository_gpg` }}", |
| 53 | "APT_MIRANTIS_SALT_REPO={{ user `apt_mirantis_salt_repo` }}" |
| 54 | ], |
| 55 | "type": "shell", |
| 56 | "execute_command": "chmod +x {{ .Path }}; {{ .Vars }} {{ .Path }}", |
Jiri Broulik | 4ea221c | 2018-04-10 13:48:06 +0200 | [diff] [blame] | 57 | "scripts": [ |
| 58 | "scripts/base.sh", |
| 59 | "scripts/motd.sh", |
| 60 | "scripts/network.sh", |
| 61 | "scripts/salt_bootstrap.sh", |
| 62 | "scripts/salt.sh" |
| 63 | ] |
| 64 | }, |
| 65 | { |
| 66 | "type": "file", |
| 67 | "source": "files/var/maas", |
| 68 | "destination": "/var/lib/maas/.maas_login.sh" |
| 69 | }, |
| 70 | { |
| 71 | "type": "file", |
| 72 | "source": "files/var/jenkins", |
| 73 | "destination": "/var/lib/jenkins/org.codefirst.SimpleThemeDecorator.xml" |
| 74 | }, |
| 75 | { |
| 76 | "environment_vars": [ |
| 77 | "HOME=/root", |
| 78 | "MCP_VERSION={{ user `mcp_version` }}" |
| 79 | ], |
| 80 | "type": "shell", |
| 81 | "pause_before": "10s", |
| 82 | "scripts": [ |
| 83 | "scripts/security.sh", |
| 84 | "scripts/cleanup.sh" |
| 85 | ] |
| 86 | }, |
| 87 | { |
| 88 | "type": "file", |
| 89 | "source": "files/etc/cloud/cloud.cfg.d/99_tcp.cfg", |
| 90 | "destination": "/etc/cloud/cloud.cfg.d/99_tcp.cfg" |
| 91 | }, |
| 92 | { |
| 93 | "type": "file", |
| 94 | "source": "files/etc/cloud/cloud.cfg", |
| 95 | "destination": "/etc/cloud/cloud.cfg" |
| 96 | } |
| 97 | ], |
| 98 | "builders": [ |
| 99 | { |
| 100 | "type": "qemu", |
| 101 | "qemuargs": [ |
| 102 | [ |
| 103 | "-m", |
| 104 | "8096M" |
| 105 | ], |
| 106 | [ |
| 107 | "-fda", |
| 108 | "config-drive/cloudata.iso" |
| 109 | ], |
| 110 | [ |
| 111 | "-smp", |
| 112 | "4" |
| 113 | ] |
| 114 | ], |
| 115 | "vm_name": "{{ user `image_name` }}-{{ isotime \"200601021504\" }}", |
Jiri Broulik | b59b154 | 2018-04-10 18:33:28 +0200 | [diff] [blame] | 116 | "output_directory": "images/{{ user `image_name` }}-qemu-{{ isotime \"200601021504\" }}", |
Jiri Broulik | 4ea221c | 2018-04-10 13:48:06 +0200 | [diff] [blame] | 117 | "format": "qcow2", |
Jiri Broulik | 2c75a20 | 2018-04-10 15:05:38 +0200 | [diff] [blame] | 118 | "iso_checksum": "566efef1d6f12e7d3a994c2405bdb642", |
| 119 | "iso_checksum_type": "md5", |
| 120 | "iso_url": "http://cloud-images.ubuntu.com/releases/xenial/release-20180306/ubuntu-16.04-server-cloudimg-amd64-disk1.img", |
| 121 | "disk_image": true, |
Jiri Broulik | 4ea221c | 2018-04-10 13:48:06 +0200 | [diff] [blame] | 122 | "accelerator": "kvm", |
| 123 | "disk_size": "{{ user `disk_size`}}", |
Jiri Broulik | 4ea221c | 2018-04-10 13:48:06 +0200 | [diff] [blame] | 124 | "headless": true, |
| 125 | "ssh_username": "{{user `user`}}", |
| 126 | "ssh_password": "{{user `password`}}", |
Jiri Broulik | 2c75a20 | 2018-04-10 15:05:38 +0200 | [diff] [blame] | 127 | "shutdown_command": "shutdown -P now", |
Jiri Broulik | 4ea221c | 2018-04-10 13:48:06 +0200 | [diff] [blame] | 128 | "boot_wait": "2s", |
| 129 | "ssh_wait_timeout": "360s" |
| 130 | } |
| 131 | ] |
| 132 | } |