In this Mini-Project, I implemented configuration management technology using an Ansible and running a simple service, Apache. And I’ll install it on 2 slaves at once. So, what are they?

Configuration Management

Configuration management systems are designed to make controlling large numbers of servers easy for administrators and operations teams. They allow controlling many different systems in an automated way from one central location.

Ansible

Ansible is an open-source software provisioning, configuration management, and application-deployment tool. It includes its own declarative language to describe system configuration.

Ansible is the simplest solution for configuration management available. It’s designed to be minimal in nature, consistent, secure and highly reliable, with an extremely low learning curve for administrators, developers, and IT managers.

How Does Ansible Work?

Image for post

Ansible works by configuring client machines from a computer that has the Ansible components installed and configured.

It communicates over normal SSH channels to retrieve information from remote machines, issue commands, and copy files. Because of this, an Ansible system does not require any additional software to be installed on the client computers.

This is one way that Ansible simplifies the administration of servers. Any server that has an SSH port exposed can be brought under Ansible’s configuration umbrella, regardless of what stage it is at in its life cycle. This means that any computer that you can administer through SSH, you can also administer through Ansible.

Configuration files are mainly written in the YAML data serialization format due to its expressive nature and its similarity to popular markup languages. Ansible can interact with hosts either through command-line tools or its configuration scripts, which are known as Playbooks.

Apache

Apache web server is a popular open-source HTTP web server tool that is widely used for the deployment of webpages. It can be installed in any operating system.

Step 1 — Installing Ansible

To begin using Ansible as a means of managing your various servers, you need to install the Ansible software on at least one machine as a master.

To get the latest version of Ansible for Ubuntu, you can add the project’s PPA (personal package archive) to your system. Before doing this, you should first ensure that you have the package installed.

- Update package

# apt update

- Install a few prerequisite packages

# apt install software-properties-common

- Add the Ansible PPA (personal package archive)

# apt-add-repository ppa:ansible/ansible

- Update the package with the newly added repo

# apt update

- Install Ansible

# apt install ansible

Step 2 — Configuring Ansible Hosts

- Access key

As mentioned previously, Ansible primarily communicates with client computers through SSH. While it certainly has the ability to handle password-based SSH authentication, using SSH keys can help to keep things simple. But, the slaves here using EC2 Instances, so we use a keypair that has applied on to connect over SSH.

#ansible #apache #automation #devops #projects

Mini-Project: Simple Automation Using Ansible
6.80 GEEK