Ansible Essentials: Mastering Server Management and Configuration


Configuration Management is a crucial process for DevOps engineers to efficiently manage server configurations and infrastructure.
Example: There is company ‘ABC’ which has 100 on-premises servers which was created and managed by a System admin. And these servers are posted as below: 50 → Linux, 25 → CentOs, 25 → Ubuntu.
Managing Servers means : 1. upgrades, 2. Secure patches, 3. Installation
If there are limited servers system admin used to write the scripts to manage the servers based on the operating system. But if we have 1000 servers it is difficult to loop over the script or commands for the on-premise servers.
In addition to that now the cloud servers came into picture where it has 10X servers than on-premises which is even more difficult for system admin to manage these servers.
So, here Configuration Management comes into picture. The main aim of this is to manage configurations of the multiple servers.
Puppet, Chef, Ansible and Salt are some of the most popular tools in the field of configuration Management. However, Ansible is the mostly used tool in the market.
Why Ansible?
- Ansible uses Push Mechanism Model
Ex: Think there is an Devops engineer who manages 10 AWS EC2 Instances when there is an updates in configurations. If he is using Ansible he used push mechanism to do that. Push mechanism means the devops engineer can write the ansible playbook in his local environment and push the configuration to 10 EC2 Instances.
Ansible is Agentless Model
No configuration is needed which means we just feed the names of the servers with IP address or DNS of the server in the inventory file and also enable password less authentication to connect to EC2 instances. And with this model is very to easy to scale-up or scale-down our servers.
- Dynamic Inventory: If we are creating 100 new servers in our account. Ansible monitors all the time and if the new server is created it directly considers it as it is managed you.
Ansible provide very good support for Windows / Linux servers
Ansible is simple(Yaml) manifest where Ansible playbooks can be written in yaml.
We can write our own Ansible modules and anyone can use these modules from Ansible galaxy.
Disadvantages of Ansible:
Windows servers has slight problems with Ansible
Debugging should be improved
Performance can be improved
Basic Interview Questions:
1. What is the programming language used in Ansible?
Python is programming is the language used write modules in Ansible and contribute to Ansible.
2. Does Ansible supports windows or Linux?
Ansible supports both windows and Linux. For Linux it uses the protocol called SSH and for windows uses win RM.
3. Why did you choose Ansible over the other configuration management tools?
Read why Ansible written above.
4. Is Ansible Push mechanism or Pull mechanism?
Ansible is Push mechanism.
5. What programming language does Ansible uses?
YAML is used as programming language.
6. Does Ansible supports all the cloud providers?
Yes It supports all cloud providers and it doesn’t matter about any cloud it check if it is publicably accessible or It has SSH allowed from Ansible machine.
Conclusion:
Ansible stands out as a powerful and efficient tool for configuration management, particularly in environments with a large number of servers. Its push mechanism, agentless model, and support for both Windows and Linux servers make it a versatile choice for DevOps engineers. While there are areas for improvement, such as debugging and performance, Ansible's simplicity and the ability to write custom modules provide significant advantages. As organizations continue to scale their infrastructure, mastering Ansible can streamline server management and enhance operational efficiency.
Subscribe to my newsletter
Read articles from Manoj Pruthvi Mandala directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by

Manoj Pruthvi Mandala
Manoj Pruthvi Mandala
Senior DevOps Engineer with extensive experience in configuration management and technical support, proficient in AWS, Docker, Kubernetes, Terraform, and Ansible. Passionate about process automation, enhancing system performance, and architecting scalable, secure cloud infrastructures.