---
- name: Install Nginx Web Server on RedHat Family
  yum:
    name=nginx
    state=latest
  when:
    ansible_os_family == "RedHat"
  notify:
    - nginx systemd
- name: insert firewalld rule for nginx
  firewalld:
    port=80/tcp permanent=true state=enabled immediate=yes
  ignore_errors:
    yes
- name: Disable SELinux
  selinux:
    state: disabled
- name: Copy nginx configuration 
  template:
    src=nginx.conf dest=/etc/nginx/nginx.conf
  notify: 
    - nginx restart

