This repository has been archived by the owner on Jul 2, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
/
CentOS-7-Minimal-Cloud-Init-virtualbox.json
197 lines (197 loc) · 8.47 KB
/
CentOS-7-Minimal-Cloud-Init-virtualbox.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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
{
"variables": {
"build_export_format": "ovf",
"build_iso_checksum": "07b94e6b1a0b0260b94c83d6bb76b26bf7a310dc78d7a9c7432809fb9bc6194a",
"build_iso_checksum_type": "sha256",
"build_iso_filename": "CentOS-7-x86_64-Minimal-2009.iso",
"build_iso_target_path": "isos/x86_64",
"build_name": "CentOS-7.9.2009-x86_64-Minimal-Cloud-Init-en_US",
"build_output_directory": "builds",
"guest_boot_timeout": "0",
"guest_bootloader_append": "net.ifnames=0 biosdevname=0",
"guest_cpus": "1",
"guest_firewall_disabled": "false",
"guest_hard_disk_size": "40960",
"guest_keyboard": "us",
"guest_language": "en_US.UTF-8",
"guest_lv_root_fstype": "ext4",
"guest_lv_root_mkfsoptions": "-i 4096",
"guest_lv_root_size": "1024",
"guest_lv_swap_size": "4096",
"guest_name": "CentOS-7.9.2009-x86_64-Minimal-Cloud-Init-en_US",
"guest_partition_boot_fstype": "ext4",
"guest_partition_boot_size": "1024",
"guest_memory": "1024",
"guest_selinux": "permissive",
"guest_timezone": "Etc/UTC",
"guest_vram": "16",
"guest_vg_root_reserved_space": "0",
"ssh_root_password": "centos",
"ssh_user": "centos",
"ssh_user_authorized_keys": "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoPkcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NOTd0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcWyLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQ== vagrant insecure public key",
"ssh_user_home": "/home/centos",
"ssh_user_password": "centos",
"ssh_user_shell": "/bin/bash",
"ssh_user_sudo": "ALL=(ALL) NOPASSWD:ALL",
"vagrantfile_template": "CentOS-7.Vagrantfile"
},
"builders": [
{
"type": "virtualbox-iso",
"name": "{{user `build_name`}}",
"boot_command": [
"<esc><wait>",
"linux ks=http://{{.HTTPIP}}:{{.HTTPPort}}/centos-7-minimal.cfg",
" BOOT_TIMEOUT={{user `guest_boot_timeout`}}",
" BOOTLOADER_APPEND=\"{{user `guest_bootloader_append`}}\"",
" BOOTLOADER_THEME=details",
" LANG={{user `guest_language`}}",
" KEYTABLE={{user `guest_keyboard`}}",
" TIMEZONE={{user `guest_timezone`}}",
" ROOTPW={{user `ssh_root_password`}}",
" FIREWALL_DISABLED={{user `guest_firewall_disabled`}}",
" SELINUX={{user `guest_selinux`}}",
" LV_ROOT_FSTYPE={{user `guest_lv_root_fstype`}}",
" LV_ROOT_MKFSOPTIONS=\"{{user `guest_lv_root_mkfsoptions`}}\"",
" LV_ROOT_SIZE={{user `guest_lv_root_size`}}",
" LV_SWAP_SIZE={{user `guest_lv_swap_size`}}",
" PART_BOOT_FSTYPE={{user `guest_partition_boot_fstype`}}",
" PART_BOOT_SIZE={{user `guest_partition_boot_size`}}",
" VG_ROOT_RESERVED_SPACE={{user `guest_vg_root_reserved_space`}}",
"<enter><wait>"
],
"boot_keygroup_interval": "500ms",
"boot_wait": "3s",
"disk_size": "{{user `guest_hard_disk_size`}}",
"format": "{{user `build_export_format`}}",
"guest_additions_mode": "disable",
"guest_os_type": "RedHat_64",
"hard_drive_interface": "sata",
"headless": true,
"http_directory": "http",
"iso_checksum": "{{user `build_iso_checksum`}}",
"iso_interface": "sata",
"iso_target_path": "{{user `build_iso_target_path`}}",
"iso_url": "{{user `build_iso_target_path`}}/{{user `build_iso_filename`}}",
"ssh_username": "root",
"ssh_password": "{{user `ssh_root_password`}}",
"ssh_port": 22,
"ssh_wait_timeout": "10m",
"shutdown_command": "/sbin/shutdown --no-wall -P now",
"shutdown_timeout": "1m",
"vboxmanage": [
["modifyvm","{{.Name}}","--accelerate2dvideo","off"],
["modifyvm","{{.Name}}","--accelerate3d","off"],
["modifyvm","{{.Name}}","--audio","none"],
["modifyvm","{{.Name}}","--biosbootmenu","disabled"],
["modifyvm","{{.Name}}","--bioslogodisplaytime","0"],
["modifyvm","{{.Name}}","--bioslogofadein","off"],
["modifyvm","{{.Name}}","--bioslogofadeout","off"],
["modifyvm","{{.Name}}","--clipboard","disabled"],
["modifyvm","{{.Name}}","--cpus","1"],
["modifyvm","{{.Name}}","--draganddrop","disabled"],
["modifyvm","{{.Name}}","--graphicscontroller","vmsvga"],
["modifyvm","{{.Name}}","--hpet","on"],
["modifyvm","{{.Name}}","--memory","1024"],
["modifyvm","{{.Name}}","--nat-localhostreachable1", "on"],
["modifyvm","{{.Name}}","--usb","off"],
["modifyvm","{{.Name}}","--vram","10"]
],
"vboxmanage_post": [
["modifyvm","{{.Name}}","--cpus","{{user `guest_cpus`}}"],
["modifyvm","{{.Name}}","--memory","{{user `guest_memory`}}"],
["modifyvm","{{.Name}}","--vram","{{user `guest_vram`}}"],
["modifyvm","{{.Name}}","--vrde","off"],
["storagectl","{{.Name}}","--name","IDE Controller","--remove"],
["storagectl","{{.Name}}","--name","SATA Controller","--hostiocache","off"]
],
"virtualbox_version_file": ".vbox_version",
"vm_name": "{{user `guest_name`}}"
}
],
"post-processors": [
{
"type": "compress",
"output": "{{user `build_output_directory`}}/{{.BuildName}}.{{user `build_export_format`}}.tar.gz",
"compression_level": 9,
"keep_input_artifact": true
},
{
"type": "shell-local",
"execute_command": "chmod +x \"{{.Script}}\"; {{.Vars}} /bin/bash \"{{.Script}}\" {{user `vagrantfile_template`}}",
"inline_shebang": "/bin/bash -e",
"inline": [
"if [[ ! -d output-tmp ]]; then",
" mkdir output-tmp",
"fi",
"if [[ -n ${1} ]] && [[ -f ${1} ]]; then",
" echo '--> Generating Vagrantfile template.'",
" cp -pf ${1} output-tmp/${1}",
" sed -e 's~[{][{]user `ssh_user`[}][}]~{{user `ssh_user`}}~g' output-tmp/${1} > ${1}",
"fi"
]
},
{
"type": "vagrant",
"vagrantfile_template": "{{user `vagrantfile_template`}}",
"output": "{{user `build_output_directory`}}/{{.BuildName}}-{{.Provider}}.box",
"compression_level": 9,
"keep_input_artifact": true
},
{
"type": "shell-local",
"execute_command": "chmod +x \"{{.Script}}\"; {{.Vars}} /bin/bash \"{{.Script}}\" {{user `vagrantfile_template`}}",
"inline_shebang": "/bin/bash -e",
"inline": [
"if [[ -n ${1} ]] && [[ -f output-tmp/${1} ]]; then",
" echo '--> Restoring Vagrantfile template.'",
" mv -f output-tmp/${1} ${1}",
"fi",
"echo '--> Cleanup output directories.'",
"find . -mindepth 1 -maxdepth 1 -type d -name \"output-*\" -exec rm -rf '{}' +"
]
}
],
"provisioners": [
{
"type": "shell",
"execute_command": "chmod +x \"{{.Path}}\"; env {{.Vars}} /bin/bash \"{{.Path}}\"",
"remote_folder": "/var/tmp",
"skip_clean": false,
"environment_vars": [
"GUEST_LANG={{user `guest_language`}}",
"SSH_USER={{user `ssh_user`}}",
"SSH_USER_AUTHORIZED_KEYS={{user `ssh_user_authorized_keys`}}",
"SSH_USER_HOME={{user `ssh_user_home`}}",
"SSH_USER_PASSWORD={{user `ssh_user_password`}}",
"SSH_USER_SHELL={{user `ssh_user_shell`}}",
"SSH_USER_SUDO={{user `ssh_user_sudo`}}"
],
"scripts": [
"scripts/install/nfs-utils.sh",
"scripts/install/tuned-virtual-guest.sh",
"scripts/install/cloud-init.sh",
"scripts/cloud-init/disable-locale-module.sh",
"scripts/cloud-init/add-datasource-list.sh",
"scripts/cloud-init/add-logging-output.sh",
"scripts/cloud-init/add-preserve-hostname.sh",
"scripts/common/ifcfg-name-to-device.sh",
"scripts/common/sshd-config-non-root-key-auth.sh",
"scripts/common/sudoers-default-not-requiretty.sh",
"scripts/common/ssh-user.sh",
"scripts/common/seal-virtual-guest.sh",
"scripts/common/locale-trim-definitions.sh",
"scripts/common/locale-trim-translations.sh",
"scripts/common/locale-lock-sysconfig.sh",
"scripts/common/purge-documentation.sh",
"scripts/common/purge-desktop-graphics.sh",
"scripts/common/purge-temporary-directories.sh",
"scripts/common/yum-cleanup.sh",
"scripts/common/rpm-rebuild-db.sh",
"scripts/common/stop-and-truncate-logs.sh",
"scripts/common/zero-out-disks.sh",
"scripts/common/lock-root-user.sh"
]
}
]
}