nginx.yml 658 B

12345678910111213141516171819
  1. - name: Install nginx package
  2. action: ${ansible_pkg_mgr} pkg=nginx state=installed update_cache=yes
  3. when_boolean: ${with_nginx}
  4. - name: Install nginx default file configuration
  5. action: template src=nginx/default.j2 dest=/etc/default/nginx owner=root group=root mode=0644
  6. notify:
  7. - Restart nginx
  8. when_boolean: ${with_nginx}
  9. - name: Install nginx status configuration
  10. action: template src=nginx/status.conf.j2 dest=/etc/nginx/conf.d/status.conf owner=root group=root mode=0644
  11. notify:
  12. - Reload nginx
  13. when_boolean: ${with_nginx}
  14. - name: Ensure nginx is running
  15. action: service name=nginx state=started
  16. when_boolean: ${with_nginx}