9-Day4-1-NotifyHandlers
**Lab Exercise:- Notify Handlers for Event-Driven Actions
Lab 1.1: Basic Notify and Handlers
- name: Notify Handlers Demo - Basic hosts: web_servers tasks: - name: Install Apache yum: name: httpd state: present - name: Update Apache Configuration copy: src: ~/day4/httpd.conf dest: /etc/httpd/conf/httpd.conf notify: Restart Apache - name: Start Apache service: name: httpd state: started handlers: - name: Restart Apache service: name: httpd state: restarted
# Basic Apache Config ServerName localhost
ansible-playbook ~/day4/notify_basic.yaml -i ~/day3/inventory.ini
Lab 1.2: Multiple Handlers
Lab 1.3: Conditional Notifications
Optional Lab: Chain Multiple Handlers
Key Learning Points:
Last updated