blob: 4488a503232edf9f15ba08f3b6df8769363ee187 [file] [log] [blame]
Jiri Broulik4ea221c2018-04-10 13:48:06 +02001{
2 "variables": {
3 "user": "root",
4 "password": "r00tme",
5 "do_api_token": "{{ env `DO_API_TOKEN` }}",
6 "image_name": "{{ env `IMAGE_NAME` }}",
Jiri Broulik3ffb7452018-04-12 10:37:07 +02007 "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 Broulik0b211672018-04-11 09:35:47 +020020 "disk_size": "50000"
Jiri Broulik4ea221c2018-04-10 13:48:06 +020021
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 Broulik4ea221c2018-04-10 13:48:06 +020057 "scripts": [
alexzdbe10382018-04-16 11:07:38 +020058 "scripts/base_set_hostname.sh",
Jiri Broulik4ea221c2018-04-10 13:48:06 +020059 "scripts/base.sh",
60 "scripts/motd.sh",
61 "scripts/network.sh",
62 "scripts/salt_bootstrap.sh",
63 "scripts/salt.sh"
64 ]
65 },
66 {
67 "type": "file",
68 "source": "files/var/maas",
69 "destination": "/var/lib/maas/.maas_login.sh"
70 },
71 {
72 "type": "file",
73 "source": "files/var/jenkins",
74 "destination": "/var/lib/jenkins/org.codefirst.SimpleThemeDecorator.xml"
75 },
76 {
77 "environment_vars": [
78 "HOME=/root",
79 "MCP_VERSION={{ user `mcp_version` }}"
80 ],
81 "type": "shell",
82 "pause_before": "10s",
83 "scripts": [
84 "scripts/security.sh",
85 "scripts/cleanup.sh"
86 ]
87 },
88 {
89 "type": "file",
90 "source": "files/etc/cloud/cloud.cfg.d/99_tcp.cfg",
91 "destination": "/etc/cloud/cloud.cfg.d/99_tcp.cfg"
92 },
93 {
94 "type": "file",
95 "source": "files/etc/cloud/cloud.cfg",
96 "destination": "/etc/cloud/cloud.cfg"
97 }
98 ],
99 "builders": [
100 {
101 "type": "qemu",
102 "qemuargs": [
103 [
104 "-m",
105 "8096M"
106 ],
107 [
108 "-fda",
109 "config-drive/cloudata.iso"
110 ],
111 [
112 "-smp",
113 "4"
114 ]
115 ],
116 "vm_name": "{{ user `image_name` }}-{{ isotime \"200601021504\" }}",
Jiri Broulikb59b1542018-04-10 18:33:28 +0200117 "output_directory": "images/{{ user `image_name` }}-qemu-{{ isotime \"200601021504\" }}",
Jiri Broulik4ea221c2018-04-10 13:48:06 +0200118 "format": "qcow2",
Jiri Broulik2c75a202018-04-10 15:05:38 +0200119 "iso_checksum": "566efef1d6f12e7d3a994c2405bdb642",
120 "iso_checksum_type": "md5",
121 "iso_url": "http://cloud-images.ubuntu.com/releases/xenial/release-20180306/ubuntu-16.04-server-cloudimg-amd64-disk1.img",
122 "disk_image": true,
Jiri Broulik4ea221c2018-04-10 13:48:06 +0200123 "accelerator": "kvm",
124 "disk_size": "{{ user `disk_size`}}",
Jiri Broulik4ea221c2018-04-10 13:48:06 +0200125 "headless": true,
126 "ssh_username": "{{user `user`}}",
127 "ssh_password": "{{user `password`}}",
Jiri Broulik2c75a202018-04-10 15:05:38 +0200128 "shutdown_command": "shutdown -P now",
Jiri Broulik4ea221c2018-04-10 13:48:06 +0200129 "boot_wait": "2s",
130 "ssh_wait_timeout": "360s"
131 }
132 ]
133}