Saltstack Official Nginx Formula
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. # nginx.src
  2. #
  3. # Manages installation of nginx from source.
  4. {% from 'nginx/map.jinja' import nginx, sls_block with context %}
  5. nginx_deps:
  6. pkg.installed:
  7. - pkgs:
  8. - libpcre3-dev
  9. - libssl-dev
  10. - zlib1g-dev
  11. nginx_download:
  12. archive.extracted:
  13. - name: /tmp/
  14. - source: http://nginx.org/download/nginx-{{ nginx.source_version }}.tar.gz
  15. - source_hash: sha256={{ nginx.source_hash }}
  16. - archive_format: tar
  17. - if_missing: /usr/sbin/nginx-{{ nginx.source_version }}
  18. - require:
  19. - pkg: nginx_deps
  20. nginx_configure:
  21. cmd.run:
  22. - name: ./configure --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --conf-path={{ nginx.lookup.conf_file }} {{ nginx.source.opts | join(' ') }}
  23. - cwd: /tmp/nginx-{{ nginx.source_version }}
  24. - onchanges:
  25. - archive: nginx_download
  26. nginx_compile:
  27. cmd.run:
  28. - name: make
  29. - cwd: /tmp/nginx-{{ nginx.source_version }}
  30. - onchanges:
  31. - cmd: nginx_configure
  32. nginx_install:
  33. cmd.run:
  34. - name: make install
  35. - cwd: /tmp/nginx-{{ nginx.source_version }}
  36. - onchanges:
  37. - cmd: nginx_compile
  38. nginx_link:
  39. file.copy:
  40. - name: /usr/sbin/nginx-{{ nginx.source_version }}
  41. - source: /usr/sbin/nginx
  42. - onchanges:
  43. - cmd: nginx_install