forked from dmitry-lyutenko/manual_kernel_update
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Homework dmitry-lyutenko#1: Create Vagrant box
- Loading branch information
Showing
20 changed files
with
198 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/mnt/BC4017954017558C/EDU2020/git/manual_kernel_update |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# This file loads the proper rgloader/loader.rb file that comes packaged | ||
# with Vagrant so that encoded files can properly run with Vagrant. | ||
|
||
if ENV["VAGRANT_INSTALLER_EMBEDDED_DIR"] | ||
require File.expand_path( | ||
"rgloader/loader", ENV["VAGRANT_INSTALLER_EMBEDDED_DIR"]) | ||
else | ||
raise "Encoded files can't be read outside of the Vagrant installer." | ||
end |
1 change: 1 addition & 0 deletions
1
kernel_compilation_5.4/.vagrant/machines/kernel-compilation/virtualbox/action_provision
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
1.5:650ae23f-0f18-4f8d-be56-2e5cbbdbc683 |
1 change: 1 addition & 0 deletions
1
kernel_compilation_5.4/.vagrant/machines/kernel-compilation/virtualbox/action_set_name
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
1588689466 |
1 change: 1 addition & 0 deletions
1
kernel_compilation_5.4/.vagrant/machines/kernel-compilation/virtualbox/box_meta
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"name":"centos/7","version":"1905.1","provider":"virtualbox","directory":"boxes/centos-VAGRANTSLASH-7/1905.1/virtualbox"} |
1 change: 1 addition & 0 deletions
1
kernel_compilation_5.4/.vagrant/machines/kernel-compilation/virtualbox/creator_uid
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
1000 |
1 change: 1 addition & 0 deletions
1
kernel_compilation_5.4/.vagrant/machines/kernel-compilation/virtualbox/id
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
650ae23f-0f18-4f8d-be56-2e5cbbdbc683 |
1 change: 1 addition & 0 deletions
1
kernel_compilation_5.4/.vagrant/machines/kernel-compilation/virtualbox/index_uuid
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
eb3c25752e29486aba3b627137f9b5ed |
27 changes: 27 additions & 0 deletions
27
kernel_compilation_5.4/.vagrant/machines/kernel-compilation/virtualbox/private_key
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
-----BEGIN RSA PRIVATE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kM9f9X1JU5SKLbUBmj5xwUWepB | ||
38vDxBuAf4QN+Kgjde8ZeRkKtHcUCz75Ot4vOAaNAoGACazV+zUBgbPVMs8b9VTb | ||
nNDugQWDOZXZ0otguvq6VZI6ZQG9bTKiV5Q61x67eJjpQjkeNENM65saNItXIrCP | ||
wIOCi9Yh4tv8drvjgL8vBhnIjTwWZ2tHJAIHZ41PwGDzM65i0xtSIXN5xXyGMOdq | ||
d7b0gleFYkMmXWXgaGTX3KcCgYBP4G+8X0ajt/dgjT4oWsdwA9SWSnbOZFXOeP1l | ||
Mot95AMZlz7a7ONwRiqlNZeUyRk+2OuZMd4vB87lqbusWAXTNpALejbBpGO2vyes | ||
+LAST2iQO1/SNSjsoI4+klNKzgHGCXsl4MlRyCPTskPc6N0mM80LEYYQW5BhoETu | ||
/3VRUQKBgQC/LvSzNrL7m5paIe/H9uEFSvfKEx0Q+s0u6bzGsT4JG2wdmEbJ7ms9 | ||
h3lyDuqseKJiEeqZ0FX1AizH2cU29fP4hDCSOvNeby/QHD8Vq6ENqQ8EK48vOVTs | ||
CN+cKbBg6JL5V/vdkYIoEgBKrCsKWgCyYekePlnh24D2xb9nBWIQlg== | ||
-----END RSA PRIVATE KEY----- |
1 change: 1 addition & 0 deletions
1
kernel_compilation_5.4/.vagrant/machines/kernel-compilation/virtualbox/synced_folders
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |
1 change: 1 addition & 0 deletions
1
kernel_compilation_5.4/.vagrant/machines/kernel-compilation/virtualbox/vagrant_cwd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/mnt/BC4017954017558C/EDU2020/git/manual_kernel_update/kernel_compilation_5.4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# This file loads the proper rgloader/loader.rb file that comes packaged | ||
# with Vagrant so that encoded files can properly run with Vagrant. | ||
|
||
if ENV["VAGRANT_INSTALLER_EMBEDDED_DIR"] | ||
require File.expand_path( | ||
"rgloader/loader", ENV["VAGRANT_INSTALLER_EMBEDDED_DIR"]) | ||
else | ||
raise "Encoded files can't be read outside of the Vagrant installer." | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# Describe VMs | ||
MACHINES = { | ||
# VM name "kernel_compilation_5.4" | ||
:"kernel-compilation" => { | ||
# VM box | ||
:box_name => "centos/7", | ||
# VM CPU count | ||
:cpus => 6, | ||
# VM RAM size (Mb) | ||
:memory => 2048, | ||
# forwarded ports | ||
:forwarded_port => [] | ||
#:forwarded_port => [guest: 22, host: 2200, protocol: "tcp"] | ||
} | ||
} | ||
|
||
Vagrant.configure("2") do |config| | ||
MACHINES.each do |boxname, boxconfig| | ||
# Disable shared folders | ||
config.vm.synced_folder ".", "/vagrant", disabled: true | ||
# Disable audio | ||
config.vm.provider "virtualbox" do |vb| | ||
vb.customize ["modifyvm", :id, "--audio", "none"] | ||
end | ||
# Apply VM config | ||
config.vm.define boxname do |box| | ||
# Set VM base box and hostname | ||
box.vm.box = boxconfig[:box_name] | ||
box.vm.host_name = boxname.to_s | ||
# Additional network config if present | ||
#config.vm.network "private_network", adapter: 2, ip: '10.10.10.2', netmask: "255.255.255.0" | ||
#config.vm.network "public_network", adapter: 3, type: "dhcp", bridge: "enp3s0" | ||
# default router | ||
#config.vm.provision "shell", | ||
# run: "always", | ||
# inline: "route add default gw 192.168.88.1" | ||
# Port-forward config if present | ||
if boxconfig.key?(:forwarded_port) | ||
boxconfig[:forwarded_port].each do |port| | ||
box.vm.network "forwarded_port", port | ||
end | ||
end | ||
# VM resources config | ||
box.vm.provider "virtualbox" do |v| | ||
# Set VM RAM size and CPU count | ||
v.memory = boxconfig[:memory] | ||
v.cpus = boxconfig[:cpus] | ||
end | ||
end | ||
end | ||
end |
1 change: 1 addition & 0 deletions
1
packer/.vagrant/machines/kernel-update/virtualbox/action_set_name
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
1588701177 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
1000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
dd284caf-8404-4051-80ce-9b6507dd173a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
3aca5be2bce24606842ec229531688ef |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/mnt/BC4017954017558C/EDU2020/git/manual_kernel_update/packer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# This file loads the proper rgloader/loader.rb file that comes packaged | ||
# with Vagrant so that encoded files can properly run with Vagrant. | ||
|
||
if ENV["VAGRANT_INSTALLER_EMBEDDED_DIR"] | ||
require File.expand_path( | ||
"rgloader/loader", ENV["VAGRANT_INSTALLER_EMBEDDED_DIR"]) | ||
else | ||
raise "Encoded files can't be read outside of the Vagrant installer." | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
{ | ||
"variables": { | ||
"artifact_description": "CentOS 7.7 with kernel 5.4.38-1", | ||
"artifact_version": "7.7.1908", | ||
"image_name": "centos-7.7" | ||
}, | ||
|
||
"builders": [ | ||
{ | ||
"name": "{{user `image_name`}}", | ||
"type": "virtualbox-iso", | ||
"vm_name": "packer-centos-vm", | ||
|
||
"boot_wait": "10s", | ||
"disk_size": "10240", | ||
"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_checksum_type": "sha256", | ||
|
||
"boot_command": [ | ||
"<tab> text ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/vagrant.ks<enter><wait>" | ||
], | ||
|
||
"shutdown_command": "sudo -S /sbin/halt -h -p", | ||
"shutdown_timeout" : "5m", | ||
|
||
"ssh_wait_timeout": "20m", | ||
"ssh_username": "vagrant", | ||
"ssh_password": "vagrant", | ||
"ssh_port": 22, | ||
"ssh_pty": true, | ||
|
||
"output_directory": "builds", | ||
|
||
"vboxmanage": [ | ||
[ "modifyvm", "{{.Name}}", "--memory", "1024" ], | ||
[ "modifyvm", "{{.Name}}", "--cpus", "2" ] | ||
], | ||
|
||
"export_opts": | ||
[ | ||
"--manifest", | ||
"--vsys", "0", | ||
"--description", "{{user `artifact_description`}}", | ||
"--version", "{{user `artifact_version`}}" | ||
] | ||
|
||
} | ||
], | ||
|
||
"post-processors": [ | ||
{ | ||
"output": "centos-{{user `artifact_version`}}-5.4.38-1-x86_64-Minimal.box", | ||
"compression_level": "7", | ||
"type": "vagrant" | ||
} | ||
], | ||
"provisioners": [ | ||
{ | ||
"type": "shell", | ||
"execute_command": "{{.Vars}} sudo -S -E bash '{{.Path}}'", | ||
"start_retry_timeout": "1m", | ||
"expect_disconnect": true, | ||
"pause_before": "20s", | ||
"override": { | ||
"{{user `image_name`}}" : { | ||
"scripts" : | ||
[ | ||
"scripts/stage-1-mc_kernel-update.sh", | ||
"scripts/stage-2-clean.sh" | ||
] | ||
} | ||
} | ||
} | ||
] | ||
} |