Saltstack Official Nginx Formula
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

95 lines
2.5KB

  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. {%- if nginx.install_from_repo %}
  15. nginx-official-repo:
  16. pkgrepo:
  17. - managed
  18. - humanname: nginx apt repo
  19. - name: deb http://nginx.org/packages/{{ grains['os'].lower() }}/ {{ grains['oscodename'] }} nginx
  20. - file: /etc/apt/sources.list.d/nginx-official-{{ grains['oscodename'] }}.list
  21. - keyid: ABF5BD827BD9BF62
  22. - keyserver: keyserver.ubuntu.com
  23. - require_in:
  24. - pkg: nginx
  25. - watch_in:
  26. - pkg: nginx
  27. {%- else %}
  28. nginx_ppa_repo:
  29. pkgrepo:
  30. {%- if nginx.install_from_ppa %}
  31. - managed
  32. {%- else %}
  33. - absent
  34. {%- endif %}
  35. {% if salt['grains.get']('os') == 'Ubuntu' %}
  36. - ppa: nginx/{{ nginx.ppa_version }}
  37. {% else %}
  38. - name: deb http://ppa.launchpad.net/nginx/{{ nginx.ppa_version }}/ubuntu lucid main
  39. - keyid: C300EE8C
  40. - keyserver: keyserver.ubuntu.com
  41. {% endif %}
  42. - require_in:
  43. - pkg: nginx_install
  44. - watch_in:
  45. - pkg: nginx_install
  46. {%- endif %}
  47. {% endif %}
  48. {% if salt['grains.get']('os_family') == 'Suse' %}
  49. nginx_zypp_repo:
  50. pkgrepo:
  51. {%- if nginx.install_from_repo %}
  52. - managed
  53. {%- else %}
  54. - absent
  55. {%- endif %}
  56. - name: server_http
  57. - humanname: server_http
  58. - baseurl: 'http://download.opensuse.org/repositories/server:/http/openSUSE_13.2/'
  59. - enabled: True
  60. - autorefresh: True
  61. - gpgcheck: {{ nginx.lookup.gpg_check }}
  62. - gpgkey: {{ nginx.lookup.gpg_key }}
  63. - require_in:
  64. - pkg: nginx_install
  65. - watch_in:
  66. - pkg: nginx_install
  67. {% endif %}
  68. {% if salt['grains.get']('os_family') == 'RedHat' %}
  69. nginx_yum_repo:
  70. {%- if nginx.install_from_repo %}
  71. pkgrepo.managed:
  72. {%- else %}
  73. pkgrepo.absent:
  74. {%- endif %}
  75. - name: nginx
  76. - humanname: nginx repo
  77. {%- if salt['grains.get']('os') == 'CentOS' %}
  78. - baseurl: 'http://nginx.org/packages/centos/$releasever/$basearch/'
  79. {%- else %}
  80. - baseurl: 'http://nginx.org/packages/rhel/{{ nginx.lookup.rh_os_releasever }}/$basearch/'
  81. {%- endif %}
  82. - gpgcheck: {{ nginx.lookup.gpg_check }}
  83. - gpgkey: {{ nginx.lookup.gpg_key }}
  84. - enabled: True
  85. - require_in:
  86. - pkg: nginx_install
  87. - watch_in:
  88. - pkg: nginx_install
  89. {% endif %}