Closed najib277 closed 2 years ago
edit Vagrantfile file as:
1) remove line number 17 and paste below code
server2.vm.synced_folder ".", "/vagrant", type: "rsync", rsync__exclude: [".git/", "disk-0-1.vdi", "disk-0-2.vdi", ".github"]
2) remove line number 66 and paste below code
repo.vm.synced_folder ".", "/vagrant", type: "rsync", rsync__exclude: [".git/", "disk-0-1.vdi", "disk-0-2.vdi", ".github"]
3) remove line number 77 and paste below code
server1.vm.synced_folder ".", "/vagrant", type: "rsync", rsync__exclude: [".git/", "disk-0-1.vdi", "disk-0-2.vdi", ".github"]
then 4) line number 64 => remove sshpass (it's specified two times so remove one.) 5) if you are on rhel8.x then update line 64 for https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
You can still found /EMPTY file in Repo VM. it's seems like image issue. you can run "sudo truncate -s0 /EMPTY" to make space.
@bkarankar thanks a lot! these things fixed it for me (just starting out on from a W10 machine). For anyone with a fresh install like me. The last command, to truncate the directory that caused this issue, you will need to open VirtualBox and log in with the credentials listed in the README.md (this far in you will see two VMs in VirtualBox like bkarankar says log in to repo VM and run his command).
great.. Thanks You can also use below line in line number 63 repo.vm.provision :shell, :inline => "sudo rm -rf /EMPTY", run: "always"
this will delete /EMPTY file. so no need to manually login into box and no need to delete manually.
`VAGRANTFILE_API_VERSION = "2" VAGRANT_DISABLE_VBOXSYMLINKCREATE = "1" file_to_disk1 = './disk-0-1.vdi' file_to_disk2 = './disk-0-2.vdi' Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.ssh.insert_key = false config.vm.box_check_update = false
config.vm.define "server2" do |server2| server2.vm.box = "rdbreak/rhel8node"
server2.vm.network "private_network", ip: "192.168.55.151" server2.vm.network "private_network", ip: "192.168.55.175" server2.vm.network "private_network", ip: "192.168.55.176" server2.vm.synced_folder ".", "/vagrant", type: "rsync", rsync__exclude: [".git/", "disk-0-1.vdi", "disk-0-2.vdi", ".github"] server2.vm.provider "virtualbox" do |server2| server2.customize ['storagectl', :id, '--name', 'SATA Controller', '--add', 'sata', '--portcount', 2]
unless File.exist?(file_to_disk1)
server2.customize ['createhd', '--filename', file_to_disk1, '--variant', 'Fixed', '--size', 8 * 1024]
end
unless File.exist?(file_to_disk2)
server2.customize ['createhd', '--filename', file_to_disk2, '--variant', 'Fixed', '--size', 8 * 1024]
end
server2.memory = "2048"
server2.customize ['storageattach', :id, '--storagectl', 'SATA Controller', '--port', 1, '--device', 0, '--type', 'hdd', '--medium', file_to_disk1]
server2.customize ['storageattach', :id, '--storagectl', 'SATA Controller', '--port', 2, '--device', 0, '--type', 'hdd', '--medium', file_to_disk2]
end
server2.vm.provision "shell", inline: <<-SHELL
yes| mkfs.ext4 -L extradisk1 /dev/sdb
SHELL
server2.vm.provision "shell", inline: <<-SHELL
mkdir /extradisk1 ; echo \'LABEL=extradisk1 /extradisk1 ext4 defaults 0 0\' >> /etc/fstab
SHELL
server2.vm.provision "shell", inline: <<-SHELL
yes| mkfs.ext4 -L extradisk2 /dev/sdc
SHELL
server2.vm.provision "shell", inline: <<-SHELL
mkdir /extradisk2 ; echo \'LABEL=extradisk2 /extradisk2 ext4 defaults 0 0\' >> /etc/fstab
SHELL
server2.vm.provision :ansible_local do |ansible|
ansible.playbook = "/vagrant/playbooks/server2.yml"
ansible.install = false
ansible.compatibility_mode = "2.0"
ansible.inventory_path = "/vagrant/inventory"
ansible.config_file = "/vagrant/ansible.cfg"
ansible.limit = "all"
end
server2.vm.provision :shell, :inline => "reboot", run: "always"
end
config.vm.define "repo" do |repo| repo.vm.box = "rdbreak/rhel8repo" repo.vm.hostname = "repo.example.com" repo.vm.provision :shell, :inline => "sudo rm -rf /EMPTY", run: "always" repo.vm.provision :shell, :inline => "sudo sed -i 's/PasswordAuthentication no/PasswordAuthentication yes/g' /etc/ssh/sshd_config; sudo systemctl restart sshd;", run: "always" repo.vm.provision :shell, :inline => "yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm -y; sudo yum install -y python3-pip python3-devel httpd sshpass vsftpd", run: "always" repo.vm.provision :shell, :inline => " python3 -m pip install -U pip ; python3 -m pip install pexpect; python3 -m pip install ansible", run: "always" repo.vm.synced_folder ".", "/vagrant", type: "rsync", rsync__exclude: [".git/", "disk-0-1.vdi", "disk-0-2.vdi", ".github"] repo.vm.network "private_network", ip: "192.168.55.149"
repo.vm.provider "virtualbox" do |repo| repo.memory = "1024" end end
config.vm.define "server1" do |server1| server1.vm.box = "rdbreak/rhel8node" server1.vm.synced_folder ".", "/vagrant", type: "rsync", rsync__exclude: [".git/", "disk-0-1.vdi", "disk-0-2.vdi", ".github"]
server1.vm.network "private_network", ip: "192.168.55.150" server1.vm.provider :virtualbox do |server1| server1.customize ['modifyvm', :id,'--memory', '2048'] end
server1.vm.provision :ansible_local do |ansible| ansible.playbook = "/vagrant/playbooks/master.yml" ansible.install = false ansible.compatibility_mode = "2.0" ansible.inventory_path = "/vagrant/inventory" ansible.config_file = "/vagrant/ansible.cfg" ansible.limit = "all" end server1.vm.provision :shell, :inline => "reboot", run: "always" end end
`
thank you @bkarankar . With the edits, everything is deploying as it should!
Thanks for the confirmation @GrigasS
getting below error while try to set environment
==> repo: Installing rsync to the VM... ==> repo: Rsyncing folder: /cygdrive/e/rhcsa8env-master/rhcsa8env-master/ => /vagrant ==> repo: - Exclude: [".vagrant/", ".git/"] There was an error when attempting to rsync a synced folder. Please inspect the error message below for more info.
Host path: /cygdrive/e/rhcsa8env-master/rhcsa8env-master/ Guest path: /vagrant Command: "rsync" "--verbose" "--archive" "--delete" "-z" "--copy-links" "--chmod=ugo=rwX" "--no-perms" "--no-owner" "--no-group" "--rsync-path" "sudo rsync" "-e" "ssh -p 2200 -o LogLevel=FATAL -o IdentitiesOnly=yes -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i 'C:/Users/Inaya/.vagrant.d/boxes/rdbreak-VAGRANTSLASH-rhel8repo/1.1/virtualbox/vagrant_private_key'" "--exclude" ".vagrant/" "--exclude" ".git/" "/cygdrive/e/rhcsa8env-master/rhcsa8env-master/" "vagrant@127.0.0.1:/vagrant" Error: rsync: write failed on "/vagrant/disk-0-1.vdi": No space left on device (28) rsync error: error in file IO (code 11) at receiver.c(374) [receiver=3.1.3]