main.yml 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. ---
  2. - name: Deploy security headers configuration
  3. ansible.builtin.template:
  4. src: security_headers.conf.j2
  5. dest: /etc/nginx/conf.d/00-security-headers.conf
  6. owner: root
  7. group: root
  8. mode: '0644'
  9. backup: yes
  10. notify: reload nginx
  11. - name: Deploy SSL parameters configuration
  12. ansible.builtin.template:
  13. src: ssl_params.conf.j2
  14. dest: /etc/nginx/conf.d/00-ssl-params.conf
  15. owner: root
  16. group: root
  17. mode: '0644'
  18. backup: yes
  19. notify: reload nginx
  20. - name: Deploy proxy parameters configuration
  21. ansible.builtin.template:
  22. src: proxy_params.conf.j2
  23. dest: /etc/nginx/conf.d/00-proxy-params.conf
  24. owner: root
  25. group: root
  26. mode: '0644'
  27. backup: yes
  28. notify: reload nginx
  29. - name: Deploy HTTP to HTTPS redirect configuration
  30. ansible.builtin.template:
  31. src: http_redirect.conf.j2
  32. dest: /etc/nginx/conf.d/00-http-redirects.conf
  33. owner: root
  34. group: root
  35. mode: '0644'
  36. backup: yes
  37. notify: reload nginx
  38. - name: Validate NGINX configuration
  39. ansible.builtin.command: nginx -t
  40. changed_when: false