I created the simple ansible playbook to install apache on CentOS and Suse. It works on CentOS but skipping on Suse without any errors, I do not understand why.
This is the playbook:
- name: To install Apache on CentOS and Suse hosts: all gather_facts: True become: yes become_user: root
tasks:
- name: Installing Apache on CentOS or RedHat
yum:
name: httpd
state: latest
when: ansible_facts['distribution']=="CentOS" or ansible_facts['distribution']=="Red Hat Enterprise Linux"
- name: Installing Apache on Suse
zypper:
name: apache2
state: latest
when: ansible_facts['distribution']=="Suse" or ansible_facts['distribution']=="SLES"