Saltstack Official Nginx Formula
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

40 lines
1.2KB

  1. # nginx.ng.install
  2. #
  3. # Manages installation of nginx.
  4. {% from 'nginx/ng/map.jinja' import nginx, sls_block with context %}
  5. nginx_install:
  6. {% if nginx.install_from_source %}
  7. ## add source compilation here
  8. {% else %}
  9. pkg.installed:
  10. {{ sls_block(nginx.package.opts) }}
  11. - name: {{ nginx.lookup.package }}
  12. {% endif %}
  13. {% if salt['grains.get']('os_family') == 'Debian' %}
  14. nginx_ppa_repo:
  15. pkgrepo:
  16. {%- if nginx.install_from_ppa %}
  17. - managed
  18. {%- else %}
  19. - absent
  20. {%- endif %}
  21. - humanname: nginx-ppa-{{ grains['oscodename'] }}
  22. {%- if nginx.ppa_version == 'mainline' %}
  23. - name: deb http://nginx.org/packages/mainline/ubuntu/ {{ grains['oscodename'] }} nginx
  24. - key_url: http://nginx.org/keys/nginx_signing.key
  25. {%- else %}
  26. - name: deb http://ppa.launchpad.net/nginx/{{ nginx.ppa_version }}/ubuntu {{ grains['oscodename'] }} main
  27. - keyid: C300EE8C
  28. - keyserver: keyserver.ubuntu.com
  29. {%- endif %}
  30. - file: /etc/apt/sources.list.d/nginx-{{ nginx.ppa_version }}-{{ grains['oscodename'] }}.list
  31. - dist: {{ grains['oscodename'] }}
  32. - require_in:
  33. - pkg: nginx_install
  34. - watch_in:
  35. - pkg: nginx_install
  36. {% endif %}