nginx.yml 825 B

123456789101112131415161718192021222324
  1. ---
  2. - name: ensure nginx is installed
  3. apt: name=nginx-extras state=latest default_release={{ ansible_distribution_release }}-backports install_recommends=no
  4. - name: ensure nginx default configuration is disabled
  5. file: name=/etc/nginx/sites-enabled/default state=absent
  6. notify: reload nginx
  7. - name: ensure nginx ssl parameters are installed
  8. copy: src=ssl.conf dest=/etc/nginx/ssl.conf
  9. notify: reload nginx
  10. - name: Ensure unsecure default configuration is up to date
  11. template:
  12. src: nginx_unsecure_default.conf.j2
  13. dest: /etc/nginx/sites-available/unsecure_default.conf
  14. - name: Ensure unsecure default configuration is enabled
  15. become: yes
  16. file:
  17. state: link
  18. dest: /etc/nginx/sites-enabled/unsecure_default.conf
  19. src: /etc/nginx/sites-available/unsecure_default.conf
  20. notify: Reload nginx