Launch Your First Ansible Hands-On Lab For Free
Jun 08, 2023 • 0 Minute Read
What are Hands-On Labs?
Hands-On Labs is a key feature when it comes to learning practical skills. Instead of simply watching videos, with real-world scenarios for you to complete. By completing those scenarios, you are building skills that can be used directly on the job.
If you have a paid membership at Linux Academy, you can launch any of the available on our platform for as many times as you want, at no additional cost. If you’re a free , you will need in order to launch Hands-On Labs. When you , you automatically receive 35 Gems.
Most of the Hands-On Labs in our are less than 15 Gems to launch, so you could launch at least 2-3 labs as part of this walkthrough we are doing, for free. You can also earn more Gems by referring members or .
Your First Ansible Hands-On Lab
Let’s walk through an example by launching this Hands-On Lab: .
Playbooks are the heart of Ansible. They provide a means of executing numerous tasks across any number of systems. This Hands-On Lab sets you on the path to Ansible mastery by allowing you to craft and execute an Ansible playbook. By the end of the lab, you will have created your first Ansible playbook.
If you haven't already, go to this link and click on “Start Hands-On Lab.” We're ready to get started!
Real-World Scenario to Complete
In this Ansible Hands-On Lab, we will complete the following scenario:
Your supervisor has asked you to find a way to automate and audit basic system configuration for new servers in your environment. Given that Ansible is already configured at a basic level in your environment, the simplest solution would be to just write a playbook for bootstrapping your new hosts.
Follow these instructions to complete the scenario:
Create a playbook called /home/ansible/bootstrap.yml to fulfill the following bootstrap requirements:
On all provided servers:
- Edit /etc/hosts to include the following entry:
- Install elinks
- Create the user xyzcorp_audit
- Copy the files
On the provided Network servers:
- Install nmap-ncat
- Create the user xyzcorp_network
On the provided SysAdmin servers:
/home/ansible/scripts.tgzfrom the control node to
The Ansible control node has been configured for you and each testing server has already been configured for use with Ansible. The default inventory has been configured to include the groups network and sysadmin. Each group includes a sample host.
As a result of completing the scenario and the instructions above, we’ll complete the following objectives:
- Create a basic playbook for all servers in the Ansible inventory.
- Add a section to the playbook for the Network servers in the Ansible inventory.
- Add a section to the playbook for the SysAdmin servers in the Ansible inventory.
- Execute the playbook to verify your playbook works correctly
To do this, you will SSH into the Ansible Control Node with the given credentials on the lab page. This is where you will configure the playbook which will complete the tasks in our instructions and perform the actions on the other 2 nodes.
Your credentials will be different than mine, but this is what they will look like on the Hands-On Lab page
Learning Tools to Help You
If you’re not sure how to accomplish the objectives and tasks listed in the instructions, we provide both a written guide and videos. These were created to walk you through the scenario from start to finish so that if you get stuck going through this Hands-On Lab, you can look at the solution and keep moving forward.
In addition to the written guide and video guide, we also provide architectural diagrams to show you, in a visual format, what the end result looks like. If you’re a visual learner like I am, this can really help memorialize the concepts and solution.
Complete the scenario and earn a new skill!
You now have access to the Hands-On Lab environment and the training resources you need in order to complete this lab, learn a new skill, and move on to more Ansible labs!
Here are some other Ansible Hands-On Labs, for example:
- Getting Started With Ansible
- Ad-Hoc Ansible Commands
- File Manipulation with Ansible
- Deploying Services Using Ansible
- Creating a Linux VM in Azure with Ansible
- Learn Ansible by Doing with these Courses and Hands-On Labs
- ...and more
If you are , your manager can see exactly which skills you’ve gained as a result of your training on Linux Academy, and that can go a very long way!
Enjoy, and happy learning! Don’t forget to or account in order to earn more Gems.