nginx-formula/nginx/ng/install.sls

74 lines
1.8 KiB
Plaintext
Raw Normal View History

2014-05-16 00:06:48 +02:00
# nginx.ng.install
#
# Manages installation of nginx.
2014-05-19 19:22:51 +02:00
2014-05-16 00:06:48 +02:00
{% from 'nginx/ng/map.jinja' import nginx, sls_block with context %}
nginx_install:
{% if nginx.install_from_source %}
2014-05-16 00:06:48 +02:00
## add source compilation here
{% else %}
pkg.installed:
{{ sls_block(nginx.package.opts) }}
- name: {{ nginx.lookup.package }}
{% endif %}
{% if salt['grains.get']('os_family') == 'Debian' %}
nginx_ppa_repo:
pkgrepo:
{%- if nginx.install_from_ppa %}
- managed
{%- else %}
- absent
{%- endif %}
2015-02-23 22:16:41 +01:00
- ppa: nginx/{{ nginx.ppa_version }}
- require_in:
- pkg: nginx_install
- watch_in:
- pkg: nginx_install
{% endif %}
{% if salt['grains.get']('os_family') == 'Suse' %}
nginx_zypp_repo:
pkgrepo:
{%- if nginx.install_from_repo %}
- managed
{%- else %}
- absent
{%- endif %}
- name: server_http
- humanname: server_http
- baseurl: 'http://download.opensuse.org/repositories/server:/http/openSUSE_13.2/'
- enabled: True
- autorefresh: True
- gpgcheck: {{ nginx.lookup.gpg_check }}
- gpgkey: {{ nginx.lookup.gpg_key }}
- require_in:
- pkg: nginx_install
- watch_in:
- pkg: nginx_install
{% endif %}
2015-04-21 12:16:19 +02:00
{% if salt['grains.get']('os_family') == 'RedHat' %}
nginx_yum_repo:
{%- if nginx.install_from_repo %}
pkgrepo.managed:
{%- else %}
pkgrepo.absent:
{%- endif %}
2015-04-21 12:16:19 +02:00
- name: nginx
- humanname: nginx repo
{%- if salt['grains.get']('os') == 'CentOS' %}
- baseurl: 'http://nginx.org/packages/centos/$releasever/$basearch/'
2015-04-21 12:16:19 +02:00
{%- else %}
- baseurl: 'http://nginx.org/packages/rhel/{{ nginx.lookup.rh_os_releasever }}/$basearch/'
2015-04-21 12:16:19 +02:00
{%- endif %}
- gpgcheck: {{ nginx.lookup.gpg_check }}
- gpgkey: {{ nginx.lookup.gpg_key }}
2015-04-21 12:16:19 +02:00
- enabled: True
- require_in:
- pkg: nginx_install
- watch_in:
- pkg: nginx_install
{% endif %}