- name: install Apache/Httpd yum: name: - httpd state: present update_cache: yes when: - ansible_os_family == "RedHat" - name: install Apache/Httpd apt: name: - httpd state: present update_cache: yes when: - ansible_os_family == "Debian" - name: start Httpd; enabled Httpd" service: name: httpd state: started enabled: yes - name: allow Httpd throught firewalld firewalld: service: http permanent: yes state: enabled immediate: yes