Saltstack Official Nginx Formula
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. # nginx.ng.src
  2. #
  3. # Manages installation of nginx from source.
  4. {% from 'nginx/ng/map.jinja' import nginx, sls_block with context %}
  5. nginx_build_dep:
  6. {% if salt['grains.get']('os_family') == 'Debian' %}
  7. cmd.run:
  8. - name: apt-get -y build-dep nginx
  9. {% elif salt['grains.get']('os_family') == 'RedHat' %}
  10. cmd.run:
  11. - name: yum-builddep -y nginx
  12. {% else %}
  13. ## install build deps for other distros
  14. {% endif %}
  15. nginx_download:
  16. archive.extracted:
  17. - name: /tmp/
  18. - source: http://nginx.org/download/nginx-{{ nginx.source_version }}.tar.gz
  19. - source_hash: sha256={{ nginx.source_hash }}
  20. - archive_format: tar
  21. - if_missing: /usr/sbin/nginx-{{ nginx.source_version }}
  22. - require:
  23. - cmd: nginx_build_dep
  24. - onchanges:
  25. - cmd: nginx_build_dep
  26. nginx_configure:
  27. cmd.run:
  28. - name: ./configure --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --conf-path={{ nginx.lookup.conf_file or '/etc/nginx/nginx.conf' }} {{ nginx.source.opts | join(' ') }}
  29. - cwd: /tmp/nginx-{{ nginx.source_version }}
  30. - require:
  31. - archive: nginx_download
  32. - onchanges:
  33. - archive: nginx_download
  34. nginx_compile:
  35. cmd.run:
  36. - name: make
  37. - cwd: /tmp/nginx-{{ nginx.source_version }}
  38. - require:
  39. - cmd: nginx_configure
  40. - onchanges:
  41. - cmd: nginx_configure
  42. nginx_install:
  43. cmd.run:
  44. - name: make install
  45. - cwd: /tmp/nginx-{{ nginx.source_version }}
  46. - require:
  47. - cmd: nginx_compile
  48. - onchanges:
  49. - cmd: nginx_compile
  50. nginx_link:
  51. file.copy:
  52. - name: /usr/sbin/nginx-{{ nginx.source_version }}
  53. - source: /usr/sbin/nginx
  54. - require:
  55. - cmd: nginx_install
  56. - onchanges:
  57. - cmd: nginx_install