09_nginx.yml 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. ---
  2. # playbooks/09_nginx.yml
  3. # Configure Nginx reverse proxy on nginx_proxy host
  4. - name: "Nginx | Configure reverse proxy"
  5. hosts: nginx_proxy
  6. become: true
  7. gather_facts: false
  8. tags:
  9. - nginx
  10. tasks:
  11. - name: "Nginx | Template Vault proxy configuration"
  12. ansible.builtin.template:
  13. src: "{{ playbook_dir }}/../templates/nginx/vault.conf.j2"
  14. dest: /etc/nginx/conf.d/vault.conf
  15. mode: "0644"
  16. owner: root
  17. group: root
  18. tags:
  19. - nginx-vault
  20. - name: "Nginx | Template Ollama API proxy configuration"
  21. ansible.builtin.template:
  22. src: "{{ playbook_dir }}/../templates/nginx/ollama-api.conf.j2"
  23. dest: /etc/nginx/conf.d/ollama-api.conf
  24. mode: "0644"
  25. owner: root
  26. group: root
  27. tags:
  28. - nginx-ollama
  29. - name: "Nginx | Template Keycloak proxy configuration"
  30. ansible.builtin.template:
  31. src: "{{ playbook_dir }}/../templates/nginx/keycloak-proxy.conf.j2"
  32. dest: /etc/nginx/conf.d/keycloak-proxy.conf
  33. mode: "0644"
  34. owner: root
  35. group: root
  36. tags:
  37. - nginx-keycloak
  38. - name: "Nginx | Validate configuration"
  39. ansible.builtin.command: nginx -t
  40. changed_when: false
  41. tags:
  42. - nginx-validate
  43. - name: "Nginx | Reload nginx"
  44. ansible.builtin.systemd:
  45. name: nginx
  46. state: reloaded
  47. tags:
  48. - nginx-validate