Setting Up Webserver with Dynamic updates using Ansible

Anshika Sharma
2 min readJan 9, 2021

--

In this we are going to Configure a webserver on a Managed Node, through Ansible with the feature of Dynamic Updates.

Our Plan

  1. Setting up httpd webserver over Managed Node.
  2. Adding configuration files
  3. Handling the service, to be started only when there are some changes in the configurations.

Implementation

Step 1: First of all configure the inventory file.

inventory file

Step 2: Configure the ansible configuration file

ansible configuration file

Step 3: Creating the ansible playbook.

Step 4: Create a configuration file for the configuring webserver

conf file

There can be any port number as well as any Document root.

Step 5: Check the connectivity to the Managed Node.

Command:ansible -m ping all”

Successfully connecting to the Managed node

Step 6: Executing the playbook

Command: “ansible-playbook service.yml”

Successfully configured the Managed Node

Step 7: Checking that the Managed node is configured properly or not?

httpd is installed
Service is running
Running Process on the specified port

Step 8: Try to execute the playbook again.

As we are not making any changes in the conf file, so it won’t restart the service!!!

Service is not started again

Just like this we can have multiple use cases of Ansible.

💫Keep Learning, Keep Sharing💫

--

--

Anshika Sharma
Anshika Sharma

Written by Anshika Sharma

I am a tech enthusiast, researcher and work for integrations. I love to explore and learn about the new technologies and their right concepts from its core.

No responses yet