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