This repository has been archived by the owner on Nov 28, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 25
/
centos8.json
87 lines (87 loc) · 2.88 KB
/
centos8.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
{
"variables": {
"boot_wait": "5s",
"disk_size": "40960",
"iso_checksum": "9602c69c52d93f51295c0199af395ca0edbe35e36506e32b8e749ce6c8f5b60a",
"iso_url": "https://vault.centos.org/8.5.2111/isos/x86_64/CentOS-8.5.2111-x86_64-boot.iso",
"memsize": "1024",
"numvcpus": "1",
"ssh_password" : "packer",
"ssh_username" : "packer",
"vm_name": "CentOS-8-x86_64-2111"
},
"builders": [
{
"type": "vmware-iso",
"boot_command": [
"<tab><bs><bs><bs><bs><bs>inst.text inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/ks.cfg<enter><wait>"
],
"boot_wait": "{{ user `boot_wait` }}",
"disk_size": "{{ user `disk_size` }}",
"disk_type_id": "0",
"guest_os_type": "centos-64",
"headless": false,
"http_directory": "http",
"iso_checksum": "{{ user `iso_checksum` }}",
"iso_url": "{{ user `iso_url` }}",
"shutdown_command": "echo 'packer'|sudo -S /sbin/halt -h -p",
"ssh_password": "{{ user `ssh_password` }}",
"ssh_port": 22,
"ssh_username": "{{ user `ssh_username` }}",
"ssh_timeout": "30m",
"vm_name": "{{ user `vm_name` }}",
"vmx_data": {
"memsize": "{{ user `memsize` }}",
"numvcpus": "{{ user `numvcpus` }}",
"virtualHW.version": "14"
}
},
{
"type": "virtualbox-iso",
"boot_command": [
"<tab><bs><bs><bs><bs><bs>inst.text inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/ks.cfg<enter><wait>"
],
"boot_wait": "{{ user `boot_wait` }}",
"disk_size": "{{ user `disk_size` }}",
"guest_os_type": "RedHat_64",
"headless": false,
"http_directory": "http",
"iso_checksum": "{{ user `iso_checksum` }}",
"iso_url": "{{ user `iso_url` }}",
"shutdown_command": "echo 'packer'|sudo -S /sbin/halt -h -p",
"ssh_password": "{{ user `ssh_password` }}",
"ssh_port": 22,
"ssh_username": "{{ user `ssh_username` }}",
"ssh_timeout": "30m",
"vm_name": "{{ user `vm_name` }}",
"vboxmanage": [
["modifyvm", "{{.Name}}", "--memory", "{{ user `memsize` }}"],
["modifyvm", "{{.Name}}", "--cpus", "{{ user `numvcpus` }}"]
]
}
],
"provisioners": [
{
"type": "shell",
"execute_command": "echo 'packer'|{{.Vars}} sudo -S -E bash '{{.Path}}'",
"inline": [
"dnf -y update",
"dnf -y install python3",
"python3 -m pip install --upgrade pip",
"alternatives --set python /usr/bin/python3",
"pip3 install ansible"
]
},
{
"type": "ansible-local",
"playbook_file": "scripts/setup.yml"
},
{
"type": "shell",
"execute_command": "echo 'packer'|{{.Vars}} sudo -S -E bash '{{.Path}}'",
"scripts": [
"scripts/cleanup.sh"
]
}
]
}