Newer
Older
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
# Image build
## Requirements
- [Packer](https://packer.io): this is the tool that will automate all the steps of image creation
- [VMware OVF Tool](https://code.vmware.com/web/tool/4.4.0/ovf): this is required by Packer to export the image from the VMware Hypervisor
- A running and reachable VMware ESXi Hypervisor
## Prepare Packer file
Copy the example Packer file `packer/example.json`, for example to `packer/mymediaserver.json`, and edit the copied file.
These variable must be configured:
- `variables.name`: used to set the output filename and the machine hostname
- `variables.esx_*`: VMware hypervisor connection settings
- `variables.network_*`: used to pre-configure network settings, leave empty to ignore
- `variables.skyreach_*`: use either `system_key` or `activation_key` and leave the other empty
Then you need the groups that will be applied to the machine, for example for a MediaServer:
```json
{
[...]
"provisioners": [
[...]
{
"type": "ansible",
[...]
"groups": [
"monitor",
"postgres",
"manager",
"wowza",
"celerity",
"server",
"import"
]
}
]
}
```
For a worker:
```json
{
[...]
"provisioners": [
[...]
{
"type": "ansible",
[...]
"groups": [
"worker"
]
}
]
}
```
You can also pass additional variables to ansible in `provisionners['1'].extra_arguments`.
## Build image
Check that the Packer file is valid (the hypervisor must be reachable):
```
make image-validate build=packer/mymediaserver.json
```
Build the OVA:
```sh
make image build=packer/mymediaserver.json
```