This repository contains a vagrant configuration that describes the infrastructure of nodes that can be used for RHCE exam preparation (EX294). The idea of creating such a similar project in comparison to what's currently available is to provide a set of exercises and solutions that are relevant to the configuration and allow the people preparing for the exam to check the exact steps they need to follow in order to solve them
The whole purpose of using this project is to practice. Don't waste time, spin up machines and check out this repository. More content is going to be added soon
Vagrant file has a description of a minimal installation and infrastructure description
There are five nodes in total deployed
- 1 control node
- 4 managed nodes
Each managed host can be accessed directly through Vagrant/VirtualBox using root
account. Root password is vagrant
. On top of that managed hosts are accessible from the controller node with use of ssh
All machines have two network adapters configured. One is used for NAT access and the second one allows hosts to talk to each other. There is a third adapter not used nor configured. It is left in such a state intentionally to allow the users to perform more sophisticated exercises.
There are symbolic names associated with each host, here is how the definitions look like
192.168.56.100 controller controller.example.com
192.168.56.101 managed1 managed1.example.com
192.168.56.102 managed2 managed2.example.com
192.168.56.103 managed3 managed3.example.com
192.168.56.104 managed4 managed4.example.com
Each managed host has two disks bound to it. One is taken by the system and the second one is spare and meant to be used for educational purposes. The controller node has a single drive attached
- Install homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
- Install VirtualBox
brew install --cask virtualbox
- Install Vagrant
brew install --cask vagrant
- Check out the repo
git clone https://github.com/mateuszstompor/rhce-environment.git
- Navigate to the repo
cd rhce-environment
- Provision
vagrant up --provision
In order to access control-node execute
vagrant ssh controller
vagrant halt
vagrant up
In order to test if everything works correctly an ad-hoc command can be used
- SSH to the control node from your host machine
vagrant ssh controller
- Create a project directory
mkdir -p helloworld
- Navigate to the project's directory
cd helloworld
- Create an inventory file
echo "[servers]" > inventory
for i in {1..4}; do
echo managed$i >> inventory
done
- Install ansible
sudo yum install -y ansible
- Execute ping command which checks connectivity
ansible localhost,servers -i inventory -m ping
You should see something similar to the below output, it's an indication of correctly working infrastructure
localhost | SUCCESS => {
"changed": false,
"ping": "pong"
}
managed1 | SUCCESS => {
"ansible_facts": {
"discovered_interpreter_python": "/usr/libexec/platform-python"
},
"changed": false,
"ping": "pong"
}
managed3 | SUCCESS => {
"ansible_facts": {
"discovered_interpreter_python": "/usr/libexec/platform-python"
},
"changed": false,
"ping": "pong"
}
managed4 | SUCCESS => {
"ansible_facts": {
"discovered_interpreter_python": "/usr/libexec/platform-python"
},
"changed": false,
"ping": "pong"
}
managed2 | SUCCESS => {
"ansible_facts": {
"discovered_interpreter_python": "/usr/libexec/platform-python"
},
"changed": false,
"ping": "pong"
}