Ansible 4: Playbooks with notify & Handlers

 

Above example : 

task1 => ensures httpd latest version is installed

task2 => copy the apache config file from local machine to target servers

upon completion of config file copy to target machine, it notifies the handler to restart the apache service

task3 => Finally enable apache service to start at the boot configuration


Note:

There is an option to do pre-validation of how many hosts will be affected by running a particular playbook using below command synstax


ansible-playbook install.yml --list-hosts


Comments

Popular posts from this blog

Ansible step3 (Play books)

Ansible Step1