You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

52 lines
991 B

  1. ---
  2. - name: Add APT key for nginx repository
  3. apt_key:
  4. url: https://nginx.org/keys/nginx_signing.key
  5. - name: Add nginx APT repository
  6. apt_repository:
  7. repo: deb http://nginx.org/packages/debian/ buster nginx
  8. - name: Install nginx
  9. apt:
  10. name: nginx
  11. - name: Start and enable nginx service
  12. service:
  13. name: nginx
  14. state: started
  15. enabled: true
  16. - name: Create nginx.conf file
  17. template:
  18. src: nginx.conf.jinja2
  19. dest: /etc/nginx/nginx.conf
  20. owner: root
  21. group: root
  22. mode: 0644
  23. notify:
  24. - Reload nginx
  25. - name: Create sites-available directory
  26. file:
  27. path: /etc/nginx/sites-available
  28. state: directory
  29. owner: root
  30. group: root
  31. mode: 0755
  32. - name: Create sites-enabled directory
  33. file:
  34. path: /etc/nginx/sites-enabled
  35. state: directory
  36. owner: root
  37. group: root
  38. mode: 0744
  39. - name: Add logrotate config
  40. copy:
  41. src: logrotate
  42. dest: /etc/logrotate.d/nginx
  43. owner: root
  44. group: root
  45. mode: 0644