Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
nem0xff committed May 11, 2020
1 parent 7b36bf8 commit dfc297a
Show file tree
Hide file tree
Showing 9 changed files with 11,309 additions and 32 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.vagrant/
*.box
packer/packer_cache/
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
OTUS "Администратор Linux" Задание №1
---

Ядро собирается из исходных текстов с поддержкой Virtual Box Additionsl tools.

Итоговый образ в Vagrant Cloud - "nem0xff/centos-7.7"
9 changes: 5 additions & 4 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ MACHINES = {
# VM name "kernel update"
:"kernel-update" => {
# VM box
:box_name => "centos/7",
:box_name => "nem0xff/centos-7.7",
# VM CPU count
:cpus => 2,
:cpus => 28,
# VM RAM size (Mb)
:memory => 1024,
:memory => 4096,
# networks
:net => [],
# forwarded ports
Expand All @@ -18,7 +18,8 @@ MACHINES = {
Vagrant.configure("2") do |config|
MACHINES.each do |boxname, boxconfig|
# Disable shared folders
config.vm.synced_folder ".", "/vagrant", disabled: true
config.vbguest.auto_update = false
config.vm.synced_folder ".", "/vagrant", disabled: false
# Apply VM config
config.vm.define boxname do |box|
# Set VM base box and hostname
Expand Down
24 changes: 14 additions & 10 deletions packer/centos.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"variables": {
"artifact_description": "CentOS 7.7 with kernel 5.x",
"artifact_version": "7.7.1908",
"artifact_version": "7.7.2003",
"image_name": "centos-7.7"
},

Expand All @@ -12,14 +12,16 @@
"vm_name": "packer-centos-vm",

"boot_wait": "10s",
"disk_size": "10240",
"disk_size": "25240",
"guest_os_type": "RedHat_64",
"http_directory": "http",

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

"guest_additions_path": "VBoxGuestAdditions.iso",

"boot_command": [
"<tab> text ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/vagrant.ks<enter><wait>"
],
Expand All @@ -36,8 +38,8 @@
"output_directory": "builds",

"vboxmanage": [
[ "modifyvm", "{{.Name}}", "--memory", "1024" ],
[ "modifyvm", "{{.Name}}", "--cpus", "2" ]
[ "modifyvm", "{{.Name}}", "--memory", "4096" ],
[ "modifyvm", "{{.Name}}", "--cpus", "28" ]
],

"export_opts":
Expand All @@ -53,7 +55,7 @@

"post-processors": [
{
"output": "centos-{{user `artifact_version`}}-kernel-5-x86_64-Minimal.box",
"output": "centos-{{user `artifact_version`}}-kernel-5-x86_64.box",
"compression_level": "7",
"type": "vagrant"
}
Expand All @@ -62,15 +64,17 @@
{
"type": "shell",
"execute_command": "{{.Vars}} sudo -S -E bash '{{.Path}}'",
"start_retry_timeout": "1m",
"start_retry_timeout": "3m",
"expect_disconnect": true,
"pause_before": "20s",
"pause_before": "5s",

"override": {
"{{user `image_name`}}" : {
"scripts" :
[
"scripts/stage-1-kernel-update.sh",
"scripts/stage-2-clean.sh"
"scripts/stage-2-additional-tools.sh",
"scripts/stage-3-clean.sh"
]
}
}
Expand Down
Loading

0 comments on commit dfc297a

Please sign in to comment.