RHCE lab setup scripts
Vagrant files for RHCE exam preparation. Learn more about vagrant at: https://www.vagrantup.com/ Sahara vagrant plugin used for snapshots: https://github.com/jedi4ever/sahara
sudo apt update && sudo apt upgrade
sudo apt -y install vagrant && sudo apt -y install zlib1g-dev
sudo apt -y install virtualbox
vagrant plugin install vagrant-vbguest && vagrant plugin install sahara
vagrant box add centos/7
If asked for provider select virtualbox.vagrant up
inside lab/virtualbox###CentOS 7.2/Fedora 24
sudo yum update
sudo yum -y install vagrant redhat-rpm-config vagrant-libvirt vagrant-libvirt-doc libvirt-devel libxslt-devel libxml2-devel virt-manager
vagrant plugin install vagrant-libvirt && vagrant plugin install fog && vagrant plugin install sahara
vagrant box add centos/7
If asked for provider select libvirt.vagrant up
inside lab/libvirtvagrant up --no-parallel
to prevent bringing up all VM's together when using libvirtsed -i '7,13s/^/#/g' virtualbox/scripts/classroom/classroom.sh
sed -i '12,18s/^/#/g' virtualbox/scripts/server/server.sh
sed -i '12,18s/^/#/g' virtualbox/scripts/desktop/desktop.sh
sed -i '7,13s/^/#/g' libvirt/scripts/classroom/classroom.sh
sed -i '12,18s/^/#/g' libvirt/scripts/server/server.sh
sed -i '12,18s/^/#/g' libvirt/scripts/desktop/desktop.sh
If possible clone the official centos mirrors so that the packages are available locally. Find the nearest mirros from: https://www.centos.org/download/mirrors/ and change in scripts/repoupdate
find scripts/ -type f -name "*.sh" -exec sed -i 's/172.16.0.143/<your-ip>/g' {} \;
sudo yum -y install httpd && sudo sed -i s/^/#/g /etc/httpd/conf.d/welcome.conf && sudo systemctl enable httpd && sudo systemctl restart httpd
find scripts/ -type f -name "*.sh" -exec sed -i 's/172.16.0.143/<your-ip>/g' {} \;
domain: example.com hosts: classroom.example.com, server1.example.com, desktop1.example.com services: DNS, NTP, Kerberos, LDAP To access run:
vagrant ssh classroom
vagrant ssh server
vagrant ssh desktop
hostname: classroom.example.com ipv4: 192.168.33.254 ipv6: 2000::254/64 kdc server: classroom.example.com REALM: EXAMPLE.COM ldap server: classroom.example.com DN: dc=example,dc=com
users:
ldap users:
ldap user home directory: /home/guests ldap authentication password for ldap users: password kerberos authentication password for ldap users: kerberos keytab files:
CA certificate: http://classroom.example.com/pki/example_ca.crt
For httpd: server1 key file: http://classroom.example.com/pki/tls/private/server1.key server1 crt file: http://classroom.example.com/pki/tls/certs/server1.crt
Sample WSGI script: http://classroom.example.com/scripts/epoch.py
hostname: server.example.com ipv4: 192.168.33.11 ipv6: set one in 2000::/64 range
users:
script for checking teaming: /usr/local/scripts/teambridge.sh
Make the script executable: chmod u+x /usr/local/scripts/teambridge.sh
and run ./usr/local/scripts/teambridge.sh
secondary disk: /dev/sdb if using virtualbox, otherwise /dev/vdb
hostname: desktop1.example.com ipv4: 192.168.33.10 ipv6: set one in 2000::/64 range users:
secondary disk: /dev/sdb if using virtualbox, otherwise /dev/vdb