2016-05-10 13:00:18 +02:00
|
|
|
# nginx.ng.pkg
|
2014-05-16 00:06:48 +02:00
|
|
|
#
|
2016-05-10 13:00:18 +02:00
|
|
|
# Manages installation of nginx from pkg.
|
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:
|
|
|
|
pkg.installed:
|
|
|
|
{{ sls_block(nginx.package.opts) }}
|
|
|
|
- name: {{ nginx.lookup.package }}
|
2016-05-09 17:31:29 +02:00
|
|
|
|
2014-08-12 04:01:38 +02:00
|
|
|
{% if salt['grains.get']('os_family') == 'Debian' %}
|
2016-04-04 15:09:31 +02:00
|
|
|
{%- if nginx.install_from_repo %}
|
|
|
|
nginx-official-repo:
|
|
|
|
pkgrepo:
|
|
|
|
- managed
|
|
|
|
- humanname: nginx apt repo
|
|
|
|
- name: deb http://nginx.org/packages/{{ grains['os'].lower() }}/ {{ grains['oscodename'] }} nginx
|
|
|
|
- file: /etc/apt/sources.list.d/nginx-official-{{ grains['oscodename'] }}.list
|
|
|
|
- keyid: ABF5BD827BD9BF62
|
|
|
|
- keyserver: keyserver.ubuntu.com
|
|
|
|
- require_in:
|
|
|
|
- pkg: nginx
|
|
|
|
- watch_in:
|
|
|
|
- pkg: nginx
|
|
|
|
{%- else %}
|
2014-08-12 04:01:38 +02:00
|
|
|
nginx_ppa_repo:
|
|
|
|
pkgrepo:
|
|
|
|
{%- if nginx.install_from_ppa %}
|
|
|
|
- managed
|
|
|
|
{%- else %}
|
|
|
|
- absent
|
|
|
|
{%- endif %}
|
2016-04-20 13:36:46 +02:00
|
|
|
{% if salt['grains.get']('os') == 'Ubuntu' %}
|
2015-02-23 22:16:41 +01:00
|
|
|
- ppa: nginx/{{ nginx.ppa_version }}
|
2016-04-20 13:36:46 +02:00
|
|
|
{% else %}
|
2016-04-20 13:53:48 +02:00
|
|
|
- name: deb http://ppa.launchpad.net/nginx/{{ nginx.ppa_version }}/ubuntu trusty main
|
2016-04-20 13:36:46 +02:00
|
|
|
- keyid: C300EE8C
|
|
|
|
- keyserver: keyserver.ubuntu.com
|
|
|
|
{% endif %}
|
2014-08-12 04:01:38 +02:00
|
|
|
- require_in:
|
|
|
|
- pkg: nginx_install
|
|
|
|
- watch_in:
|
|
|
|
- pkg: nginx_install
|
2016-04-04 15:09:31 +02:00
|
|
|
{%- endif %}
|
2014-08-12 04:01:38 +02:00
|
|
|
{% endif %}
|
2015-03-08 21:23:26 +01:00
|
|
|
|
|
|
|
{% 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
|
2016-02-24 11:11:42 +01:00
|
|
|
- gpgcheck: {{ nginx.lookup.gpg_check }}
|
|
|
|
- gpgkey: {{ nginx.lookup.gpg_key }}
|
2015-03-08 21:23:26 +01:00
|
|
|
- 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:
|
2015-08-20 09:17:55 +02:00
|
|
|
{%- 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' %}
|
2015-05-17 17:23:01 +02:00
|
|
|
- baseurl: 'http://nginx.org/packages/centos/$releasever/$basearch/'
|
2015-04-21 12:16:19 +02:00
|
|
|
{%- else %}
|
2015-05-14 02:00:12 +02:00
|
|
|
- baseurl: 'http://nginx.org/packages/rhel/{{ nginx.lookup.rh_os_releasever }}/$basearch/'
|
2015-04-21 12:16:19 +02:00
|
|
|
{%- endif %}
|
2016-02-24 11:11:42 +01:00
|
|
|
- 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 %}
|