-
Notifications
You must be signed in to change notification settings - Fork 2
/
template.json
98 lines (98 loc) · 2.6 KB
/
template.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
{
"variables": {
"build_name": "cosmic_systemvm_template"
},
"builders": [
{
"type": "qemu",
"iso_url": "http://ftp.tudelft.nl/centos.org/7/isos/x86_64/CentOS-7-x86_64-Minimal-2009.iso",
"iso_checksum": "07b94e6b1a0b0260b94c83d6bb76b26bf7a310dc78d7a9c7432809fb9bc6194a",
"output_directory": "packer_output",
"ssh_wait_timeout": "15m",
"shutdown_command": "systemctl poweroff",
"disk_size": "10240",
"format": "qcow2",
"accelerator": "kvm",
"headless": true,
"qemu_binary": "/usr/libexec/qemu-kvm",
"qemuargs": [
[
"-smp",
"4"
],
[
"-m",
"1024M"
]
],
"http_directory": "httpdir",
"http_port_min": 10082,
"http_port_max": 10089,
"host_port_min": 2222,
"host_port_max": 2229,
"ssh_username": "root",
"ssh_password": "password",
"ssh_port": 22,
"vm_name": "cosmic-systemvm",
"net_device": "virtio-net",
"disk_interface": "virtio-scsi",
"disk_cache": "unsafe",
"disk_discard": "unmap",
"disk_compression": true,
"boot_command": [
"<tab> text ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/kickstart/centos7.ks<enter><wait>"
]
}
],
"provisioners": [
{
"type": "file",
"source": "files/systemd/",
"destination": "/usr/lib/systemd/system"
},
{
"type": "shell",
"inline": [
"systemctl enable cosmic-patch-scripts",
"systemctl enable cosmic-generic-startup-hook",
"systemctl enable cosmic-generic-startup-hook.path",
"systemctl enable tmp.mount",
"systemctl enable keepalived",
"systemctl enable conntrackd",
"systemctl enable iptables",
"systemctl enable strongswan",
"systemctl enable dnsmasq",
"systemctl enable nginx",
"mkdir -p /var/cache/cloud",
"mkdir -p /opt/cosmic/startup"
]
},
{
"type": "shell",
"inline": [
"for s in rpcbind.socket rpc-gssd rpcidmapd rpc-rquotad rpc-statd rpc-statd-notify rpcbind.service; do systemctl stop $s; systemctl disable $s; done"
]
},
{
"type": "file",
"source": "files/startup/",
"destination": "/opt/cosmic/startup"
},
{
"type": "shell",
"scripts": [
"scripts/release_signature.sh",
"scripts/ssh.sh",
"scripts/qemu-ga-blacklist.sh",
"scripts/conntrack.sh"
],
"execute_command": "bash '{{.Path}}'"
},
{
"type": "shell",
"inline": [
"fstrim -v /"
]
}
]
}