nginx-formula/nginx/ng/install.sls
Roshan Bangera 03c4902b9e * added comment for pillar example
* removed override releasever variable use for CentOS
2015-06-30 19:59:47 -07:00

69 lines
1.7 KiB
Plaintext

# nginx.ng.install
#
# Manages installation of nginx.
{% from 'nginx/ng/map.jinja' import nginx, sls_block with context %}
nginx_install:
{% if nginx.install_from_source %}
## 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 %}
- 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: True
- gpgkey: 'http://download.opensuse.org/repositories/server:/http/openSUSE_13.2/repodata/repomd.xml.key'
- require_in:
- pkg: nginx_install
- watch_in:
- pkg: nginx_install
{% endif %}
{% if salt['grains.get']('os_family') == 'RedHat' %}
nginx_yum_repo:
pkgrepo.managed:
- name: nginx
- humanname: nginx repo
{%- if salt['grains.get']('os') == 'CentOS' %}
- baseurl: 'http://nginx.org/packages/centos/$releasever/$basearch/'
{%- else %}
- baseurl: 'http://nginx.org/packages/rhel/{{ nginx.lookup.rh_os_releasever }}/$basearch/'
{%- endif %}
- gpgcheck: False
- enabled: True
- require_in:
- pkg: nginx_install
- watch_in:
- pkg: nginx_install
{% endif %}