Saltstack Official Nginx Formula
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
- # 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' %}
- {%- 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 %}
- 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 %}
- {% 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 %}
-
- {% if salt['grains.get']('os_family') == 'RedHat' %}
- nginx_yum_repo:
- {%- if nginx.install_from_repo %}
- pkgrepo.managed:
- {%- else %}
- pkgrepo.absent:
- {%- endif %}
- - 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: {{ nginx.lookup.gpg_check }}
- - gpgkey: {{ nginx.lookup.gpg_key }}
- - enabled: True
- - require_in:
- - pkg: nginx_install
- - watch_in:
- - pkg: nginx_install
- {% endif %}
|