ANSIBLE : Handlers
PROBLEM : We all know that ansible is famous for it's idempotency . But if we configure some service and if we change anything in it's configuration file, then we need to restart that service. The problem is : if configuration file is unchanged, then? Then also our ansible task will run and restart service unnecessarily. In this case, ansible is not working as idempotent. Our service will restart every time we run the playbook, even if configuration file is not updated. SOLUTION : HANDLERS We can use Handlers in Ansible to tackle this problem. Handlers are just like a normal task. Handlers will perform an action when listens for a notify event. If nothing notifies a handler, it will not run. Regardless of how many tasks notify a handler, it will run only once, after all of the tasks completed in a particular play. To know more about ansible and it's playbook, check my this blog : ANSIBLE : How Industries are solving Challenges using Ans...