Upgrade & Secure Your Future with DevOps, SRE, DevSecOps, MLOps!

We spend hours on Instagram and YouTube and waste money on coffee and fast food, but won’t spend 30 minutes a day learning skills to boost our careers.
Master in DevOps, SRE, DevSecOps & MLOps!

Learn from Guru Rajesh Kumar and double your salary in just one year.


Get Started Now!

Calling Ansible handlers based on OS distributions

---
- hosts: all
tasks:
- name: create a hello world textfile
copy:
content: "Hello World!"
dest: /tmp/hello.txt
owner: root
group: root
mode: 0640
notify:
- redhat handler
- debian handler
sudo: yes
handlers:
- name: redhat handler
debug: msg='redhat'
when: ansible_distribution == "RedHat"
- name: debian handler
debug: msg='debian'
when: ansible_distribution == "Debian"
Subscribe
Notify of
guest
0 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x