From the course: Learning Ansible

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

React to configuration changes with Ansible

React to configuration changes with Ansible - Ansible Tutorial

From the course: Learning Ansible

Start my 1-month free trial

React to configuration changes with Ansible

- [Instructor] Now, if you're like me, you've been really impressed with Ansible so far but we need to make it even more flexible. We need Ansible to be able to react to things like configuration changes. Think about it. We'll often be modifying scripts so that we can make configuration changes that are required but we need Ansible to use a feature called handlers so that it can be really flexible about handling these changes. Let me demonstrate with the playbook. So here we can see our playbook that's called React with Change Example. And we're running a serial-type fashion of execution across our web servers. Notice, we're just simulating this with debugs. We install Nginx, our web server and then upgrade it and then configure it and then verify it. If there is nothing for us to configure, well, then that's great but if we do make a configuration change with this task, we need to restart the Nginx server in that…

Contents