Restarting HTTPD Service is not idempotence in nature and also consume more resources suggest a way to rectify this challenge in Ansible playbook
Idempotence means that applying an operation once or applying it multiple times has the same effect.
And here httpd service is not idempotence in nature , which means if we have written a playbook and running the same service again and again so we would to save our time and ram by stopping the nature of restarting of httpd service .WE will do something that if there is any change is the code then only service has to restart .
Here i have created a playbook with an html page displaying hello , at first when i run the service it shows many change with that orange color .
Here i have run the same file again , so now there is no change in file so service don’t restart it self .
Here is the output