Skip to content

Commit dfc297a

Browse files
committed
1 parent 7b36bf8 commit dfc297a

File tree

9 files changed

+11309
-32
lines changed

9 files changed

+11309
-32
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.vagrant/
2+
*.box
3+
packer/packer_cache/

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
OTUS "Администратор Linux" Задание №1
2+
---
3+
4+
Ядро собирается из исходных текстов с поддержкой Virtual Box Additionsl tools.
5+
6+
Итоговый образ в Vagrant Cloud - "nem0xff/centos-7.7"

Vagrantfile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ MACHINES = {
33
# VM name "kernel update"
44
:"kernel-update" => {
55
# VM box
6-
:box_name => "centos/7",
6+
:box_name => "nem0xff/centos-7.7",
77
# VM CPU count
8-
:cpus => 2,
8+
:cpus => 28,
99
# VM RAM size (Mb)
10-
:memory => 1024,
10+
:memory => 4096,
1111
# networks
1212
:net => [],
1313
# forwarded ports
@@ -18,7 +18,8 @@ MACHINES = {
1818
Vagrant.configure("2") do |config|
1919
MACHINES.each do |boxname, boxconfig|
2020
# Disable shared folders
21-
config.vm.synced_folder ".", "/vagrant", disabled: true
21+
config.vbguest.auto_update = false
22+
config.vm.synced_folder ".", "/vagrant", disabled: false
2223
# Apply VM config
2324
config.vm.define boxname do |box|
2425
# Set VM base box and hostname

packer/centos.json

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"variables": {
33
"artifact_description": "CentOS 7.7 with kernel 5.x",
4-
"artifact_version": "7.7.1908",
4+
"artifact_version": "7.7.2003",
55
"image_name": "centos-7.7"
66
},
77

@@ -12,14 +12,16 @@
1212
"vm_name": "packer-centos-vm",
1313

1414
"boot_wait": "10s",
15-
"disk_size": "10240",
15+
"disk_size": "25240",
1616
"guest_os_type": "RedHat_64",
1717
"http_directory": "http",
1818

19-
"iso_url": "http://mirror.yandex.ru/centos/7.7.1908/isos/x86_64/CentOS-7-x86_64-Minimal-1908.iso",
20-
"iso_checksum": "9a2c47d97b9975452f7d582264e9fc16d108ed8252ac6816239a3b58cef5c53d",
19+
"iso_url": "http://mirror.yandex.ru/centos/7/isos/x86_64/CentOS-7-x86_64-Minimal-2003.iso",
20+
"iso_checksum": "659691c28a0e672558b003d223f83938f254b39875ee7559d1a4a14c79173193",
2121
"iso_checksum_type": "sha256",
2222

23+
"guest_additions_path": "VBoxGuestAdditions.iso",
24+
2325
"boot_command": [
2426
"<tab> text ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/vagrant.ks<enter><wait>"
2527
],
@@ -36,8 +38,8 @@
3638
"output_directory": "builds",
3739

3840
"vboxmanage": [
39-
[ "modifyvm", "{{.Name}}", "--memory", "1024" ],
40-
[ "modifyvm", "{{.Name}}", "--cpus", "2" ]
41+
[ "modifyvm", "{{.Name}}", "--memory", "4096" ],
42+
[ "modifyvm", "{{.Name}}", "--cpus", "28" ]
4143
],
4244

4345
"export_opts":
@@ -53,7 +55,7 @@
5355

5456
"post-processors": [
5557
{
56-
"output": "centos-{{user `artifact_version`}}-kernel-5-x86_64-Minimal.box",
58+
"output": "centos-{{user `artifact_version`}}-kernel-5-x86_64.box",
5759
"compression_level": "7",
5860
"type": "vagrant"
5961
}
@@ -62,15 +64,17 @@
6264
{
6365
"type": "shell",
6466
"execute_command": "{{.Vars}} sudo -S -E bash '{{.Path}}'",
65-
"start_retry_timeout": "1m",
67+
"start_retry_timeout": "3m",
6668
"expect_disconnect": true,
67-
"pause_before": "20s",
69+
"pause_before": "5s",
70+
6871
"override": {
6972
"{{user `image_name`}}" : {
7073
"scripts" :
7174
[
7275
"scripts/stage-1-kernel-update.sh",
73-
"scripts/stage-2-clean.sh"
76+
"scripts/stage-2-additional-tools.sh",
77+
"scripts/stage-3-clean.sh"
7478
]
7579
}
7680
}

0 commit comments

Comments
 (0)