diff --git a/Vagrantfile b/Vagrantfile index 1f37e5f..c996dbb 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -4,25 +4,31 @@ file_to_disk1 = './disk-0-1.vdi' file_to_disk2 = './disk-0-2.vdi' file_to_disk3 = './disk-0-3.vdi' file_to_disk4 = './disk-0-4.vdi' +file_to_disk5 = './disk-1-3.vdi' Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| # Use same SSH key for each machine config.ssh.insert_key = false config.vm.box_check_update = false -# Repo Server +# Repo config.vm.define "repo" do |repo| - repo.vm.box = "rdbreak/rhel8repo" -# repo.vm.hostname = "repo.ansi.example.com" - repo.vm.provision :shell, :inline => "sudo rm -rf /EMPTY", run: "always" + + repo.vm.box = "rdbreak/rhel8repo" + repo.vm.provider "virtualbox" do |repo| + repo.memory = "1024" + unless File.exist?(file_to_disk5) + repo.customize ['createhd', '--filename', file_to_disk5, '--variant', 'Standard', '--size', 2 * 1024] + repo.customize ['storagectl', :id, '--name', 'SATA Controller', '--add', 'sata', '--portcount', 1] + repo.customize ['storageattach', :id, '--storagectl', 'SATA Controller', '--port', 1, '--device', 0, '--type', 'hdd', '--medium', file_to_disk5] + end + end + repo.vm.provision :shell, :inline => "pvs | grep '/dev/sdb' && echo 'The disk was already expanded!' || (pvcreate /dev/sdb; vgextend rhel_rhel8 /dev/sdb; lvextend -l +100%FREE /dev/rhel_rhel8/root; xfs_growfs /dev/rhel_rhel8/root)" + 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-7.noarch.rpm -y; sudo yum install -y sshpass python3-pip python3-devel httpd sshpass vsftpd createrepo", 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/", "*.vdi"] + repo.vm.synced_folder ".", "/vagrant", type: "rsync", rsync__exclude: ".git/" repo.vm.network "private_network", ip: "192.168.55.199" - - repo.vm.provider "virtualbox" do |repo| - repo.memory = "512" - end end # Node 1 diff --git a/playbooks/control.yml b/playbooks/control.yml index c44ef3e..d98b220 100644 --- a/playbooks/control.yml +++ b/playbooks/control.yml @@ -38,6 +38,13 @@ path: /etc/yum.repos.d/ipa.repo state: touch mode: 0755 + - name: Adding the rhel-system-repos.rpm + copy: + src: rhel-system-roles-1.0.1-1.el8.noarch.rpm + dest: /home/vagrant + owner: vagrant + group: vagrant + mode: "0775" - name: Building Repo File copy: dest: /etc/yum.repos.d/ipa.repo @@ -114,4 +121,4 @@ # # Repo/AppStream # Available to use from http://repo.ansi.example.com/BaseOS and http://repo.ansi.example.com/AppStream - " \ No newline at end of file + " diff --git a/playbooks/rhel-system-roles-1.0.1-1.el8.noarch.rpm b/playbooks/rhel-system-roles-1.0.1-1.el8.noarch.rpm new file mode 100644 index 0000000..34d2d30 Binary files /dev/null and b/playbooks/rhel-system-roles-1.0.1-1.el8.noarch.rpm differ