đź”° 11.3 Restarting HTTPD Service is not idempotence in nature and also consume more resources suggest a way to rectify this challenge in Ansible playbook!!

>>We will be using HANDLERS to solve our problem, As handlers run when they are notified.
>>So we will be launching a Httpd webserver and we only want to restart our service only when ever there are some changes in the configuration file
>>As soon as the config file is modified , the notifier will contact the handler to do the asked.
Prerequisite:
- Master Node/Controller node which is fully configured to write the playbook
- Slave Node/ Managed Node to run the playbook
So let’s get started ….
STEP-1:So let’s create playbook in controller node which can configure apache httpd webserver on target nodes with the help of handlers.

STEP-2:Running the playbook

Everything was successfully, But as we all can see here the Handlers ran as it is 1st time we changed the Config file, Now lets try to run the playbook again without changing the in the config file>We hope to see as changed=0
STEP-3: Re-running the playbook without any change in config file

So Finally task Completed. Hope you guys enjoyed and learned something.