Saltstack Official Nginx Formula
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.

60 line
1.2KB

  1. nginx-old-init:
  2. file:
  3. - rename
  4. - name: /usr/share/nginx/init.d
  5. - source: /etc/init.d/nginx
  6. - require_in:
  7. - file: nginx
  8. cmd:
  9. - wait
  10. - name: dpkg-divert --divert /usr/share/nginx/init.d --add /etc/init.d/nginx
  11. - require:
  12. - module: nginx-old-init
  13. - watch:
  14. - file: nginx-old-init
  15. - require_in:
  16. - file: nginx
  17. module:
  18. - wait
  19. - name: cmd.run
  20. - cmd: kill `cat /var/run/nginx.pid`
  21. - watch:
  22. - file: nginx-old-init
  23. - require_in:
  24. - file: nginx
  25. nginx-old-init-disable:
  26. cmd:
  27. - wait
  28. - name: update-rc.d -f nginx remove
  29. - require:
  30. - module: nginx-old-init
  31. - watch:
  32. - file: nginx-old-init
  33. nginx:
  34. pkg.installed:
  35. - name: nginx
  36. file:
  37. - managed
  38. - name: /etc/init/nginx.conf
  39. - template: jinja
  40. - user: root
  41. - group: root
  42. - mode: 440
  43. - source: salt://nginx/templates/upstart.jinja
  44. - require:
  45. - pkg: nginx
  46. - file: nginx-old-init
  47. - module: nginx-old-init
  48. service:
  49. - running
  50. - enable: True
  51. - restart: True
  52. - watch:
  53. - file: nginx
  54. - file: /etc/nginx/nginx.conf
  55. - file: /etc/nginx/conf.d/default.conf
  56. - file: /etc/nginx/conf.d/example_ssl.conf
  57. - pkg: nginx