nginx-formula/nginx/ng/install.sls
2015-02-10 16:59:49 -03:00

35 lines
972 B
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 %}
- humanname: nginx-ppa-{{ grains['oscodename'] }}
- name: deb http://ppa.launchpad.net/nginx/{{ nginx.ppa_version }}/ubuntu {{ grains['oscodename'] }} main
- file: /etc/apt/sources.list.d/nginx-{{ nginx.ppa_version }}-{{ grains['oscodename'] }}.list
- dist: {{ grains['oscodename'] }}
- keyid: C300EE8C
- keyserver: keyserver.ubuntu.com
- require_in:
- pkg: nginx_install
- watch_in:
- pkg: nginx_install
{% endif %}