Powered by Packer, Terraform, and Ansible
- A free AWS (Amazon Web Services) account is needed to use this environment.
- Once you create your AWS account, create a new IAM User (Ex. RedHatUser) with Admin privileges
- Create a role with Admin access policy for the EC2 instances (Ex. rhcsa8env-role)
- Download the key pair file (ending in .pem) and save it to your home directory.
- Use the awscli to add the credentials for the IAM user you created in step 2 (using aws configure).
- 1 VPC
- 1 NAT Gatways
- 1 Route Tables
- 1 Private Subnets
- 1 Public Subnets
- 1 Elastic IP
- 1 Security Group
- 2 EC2 Instances
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" && xcode-select --install &&brew install ansible ; brew install python ; brew install terraform ; brew install packer ; brew install awscli
- Create a separate
~/bin
directory andcd
to it. (The directory doesn't have to be ~/bin, it can be anything you want.) - Clone the environment repo to it with
git clone https://github.com/rdbreak/aws/rhcsa8-aws.git
- Change to the
aws/rhcsa8-aws
directory that is now in your~/bin
directory. - Run
terraform init
to initialize the environment - Run
terraform apply
to deploy the environment
CentOS/RHEL/Manjaro/Arch - Install all at once by Copy/Pasting the below command into your terminal as root.
NOTE - If it's been awhile since you've run yum update, do that first. Reboot if the kernel was updated. There may be some dependencies errors but don't be alarmed as this won't stop the environment from working.
pip3 install ansible packer terraform awscli
- Create a separate
~/bin
directory andcd
to it. (The directory doesn't have to be ~/bin, it can be anything you want.) - Clone the environment repo to it with
git clone https://github.com/rdbreak/aws/rhcsa8-aws.git
- Change to the
rhcsa8-aws
directory that is now in your~/bin
directory. - Run
terraform init
to initialize the environment - Run
terraform apply
to deploy the environment
When Terraform is finished building out the environment, it will output the public IPs for the server1 and 2. Use the below command to access the servers:
ssh -i "~/rhcsa8env.pem" centos@<public IP>
- If using Windows:
- Install the Latest Version of Terraform
- Install the Latest Version of Packer
- Install the Latest Version of awscli
Once the above software is installed. Do the following if you're running the environment on Windows:
- Create a separate
~/bin
directory andcd
to it using the same PowerShell/Terminal as Administrator/Root. (The directory doesn't have to be ~/bin, it can be anything you want.) - Use your browser of choice and navigate to https://github.com/rdbreak/aws/rhcsa8env, press the green “Clone or download” button then the “Download ZIP” button. Or use Github Desktop (See below).
- Once downloaded, unzip the file and move it to the directory you created earlier,
~/bin
in the above example. - Use PowerShell/Terminal as Administrator/Root again and cd to the
~/bin/aws/rhcsa8-aws
directory then run:
- Run
terraform apply
to deploy the environment
Now the deployment should be up and running!
NOTE this requires a free Github account
- Navigate to https://desktop.github.com/ and download Github Desktop.
- Create or sign in to your account.
- Click "Clone a repository from the Internet" and enter "rdbreak/aws/rhcsa8env" and choose a location then "Clone".
- You are also able to easily pull changes when they're made available.
terraform plan
- Only shows changes that will be made ifterraform apply
is runterraform apply
- Provisions and deploys the resources in the environmentterraform destroy
- Shuts down and destroys all the resources in the environment
- server1.eight.example.com
- server2.eight.example.com
Remember to add the IP addresses to your local host file if you want to connect to the guest systems with the hostname. Username - centos
- For root - use
sudo
orsudo su
Access example -ssh -i "~/rhcsa8env.pem" centos@<public IP of server>
If you're having problems with the environment, please submit an issue by going to the ISSUES
tab at the top. If you have more questions, looking for practice exams to use against this environment, or just looking for a fantastic Red Hat community to join to get your questions answered, check out the Red Hat Certs Slack Workspace. You can find the invite link at the top of this page next to the description.