Ansible Handlers
In this post, you will learn about ansible handlers.
Handlers are like if and else in ansible, suppose you have a configuration file in httpd server, and you want whenever you change something in configuration file, the httpd service must restart. In this case we will use handlers.
Components-:
Controller node(192.168.1.7), Target node(192.168.1.8)
The ansible-playbook looks like
It will only run the handlers portion only when notify will be changed.
Target Node-
httpd is running on 8081.
Playbook running when conf file is changed
Playbook running second time
You can view the webpage running on port 8081
Thank You for reading.
I would like to thanks Vimal Daga Sir.
My Email — ayanchawlae@gmail.com
My LinkedIn — https://www.linkedin.com/in/ayanchawlae/
Comments
Post a Comment