blob: 6cc5ce540e8392b43478bd0914b6c71efdce1363 [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` }}",
azvyagintsevffa75b42018-06-06 20:38:54 +030010 "bs_hostname": "cfg01",
Jiri Broulik3ffb7452018-04-12 10:37:07 +020011 "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 Broulik0b211672018-04-11 09:35:47 +020021 "disk_size": "50000"
Jiri Broulik4ea221c2018-04-10 13:48:06 +020022
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` }}",
azvyagintsevffa75b42018-06-06 20:38:54 +030045 "BS_HOSTNAME={{ user `bs_hostname` }}",
Jiri Broulik4ea221c2018-04-10 13:48:06 +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 "APT_MIRANTIS_SALT_REPO={{ user `apt_mirantis_salt_repo` }}"
56 ],
57 "type": "shell",
58 "execute_command": "chmod +x {{ .Path }}; {{ .Vars }} {{ .Path }}",
Jiri Broulik4ea221c2018-04-10 13:48:06 +020059 "scripts": [
alexzdbe10382018-04-16 11:07:38 +020060 "scripts/base_set_hostname.sh",
Jiri Broulik4ea221c2018-04-10 13:48:06 +020061 "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",
azvyagintsevffa75b42018-06-06 20:38:54 +030087 "scripts/cleanup.sh",
88 "scripts/info.sh"
Jiri Broulik4ea221c2018-04-10 13:48:06 +020089 ]
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 Broulikb59b1542018-04-10 18:33:28 +0200120 "output_directory": "images/{{ user `image_name` }}-qemu-{{ isotime \"200601021504\" }}",
Jiri Broulik4ea221c2018-04-10 13:48:06 +0200121 "format": "qcow2",
Jiri Broulik2c75a202018-04-10 15:05:38 +0200122 "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 Broulik4ea221c2018-04-10 13:48:06 +0200126 "accelerator": "kvm",
127 "disk_size": "{{ user `disk_size`}}",
Jiri Broulik4ea221c2018-04-10 13:48:06 +0200128 "headless": true,
129 "ssh_username": "{{user `user`}}",
130 "ssh_password": "{{user `password`}}",
Jiri Broulik2c75a202018-04-10 15:05:38 +0200131 "shutdown_command": "shutdown -P now",
Jiri Broulik4ea221c2018-04-10 13:48:06 +0200132 "boot_wait": "2s",
133 "ssh_wait_timeout": "360s"
134 }
135 ]
136}