Last active
April 29, 2023 12:29
-
-
Save sercangezer/b7316008a0b9bc9974e311660a828dd2 to your computer and use it in GitHub Desktop.
20230429 - Disk Ekleme - Vagrantfile
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
#============================================================================== | |
# Yazan : Sercan GEZER (sercan.gezer.TR@gmail.com) | |
# Tarih : 29 Nisan 2023 | |
# Amaç : Centos 7 kullanılarak VirtualBox üzerinde makineyi | |
# ayağa kaldırır. | |
#============================================================================== |
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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
#============================================================================== | |
# Yazan : Sercan GEZER (sercan.gezer.TR@gmail.com) | |
# Tarih : 29 Nisan 2023 | |
# Amaç : Centos 7 kullanılarak VirtualBox üzerinde makineyi | |
# ayağa kaldırır. | |
#============================================================================== | |
ENV["VAGRANT_EXPERIMENTAL"] = "disks" | |
Vagrant.configure("2") do |config| | |
config.vm.define "diskEkleme" do |sg| | |
sg.vm.box = "centos/7" | |
sg.vm.network "private_network", ip: "192.168.56.35" | |
sg.vm.hostname = "sercangezer-diskEkleme" | |
sg.ssh.forward_agent = true | |
sg.vm.disk :disk, size: "5GB", name: "disk_01" | |
sg.vm.disk :disk, size: "8GB", name: "disk_02" | |
sg.vm.provider "virtualbox" do |vb| | |
vb.memory = "4096" | |
vb.cpus= "2" | |
vb.name= "Centos7-diskEkleme" | |
end | |
# root kullanıcısı ile direkt olarak SSH bağlantısı kurmamızı sağlar. | |
sg.vm.provision :shell, :inline => "sudo sed -i 's/PasswordAuthentication no/PasswordAuthentication yes/g' /etc/ssh/sshd_config; sudo systemctl restart sshd;", run: "always" | |
# root parolasını 'root' olarak değiştirir. | |
sg.vm.provision :shell, :inline => "sudo echo -e 'root\nroot' | passwd root", run: "always" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment