Browse Source

Merge pull request #15 from tfolio/upstart-optional

Add pillar item to disable using upstart-based services
susefix
Seth House 10 years ago
parent
commit
6831d739c1
3 changed files with 11 additions and 2 deletions
  1. +2
    -0
      nginx/common.sls
  2. +8
    -2
      nginx/package.sls
  3. +1
    -0
      pillar.example

+ 2
- 0
nginx/common.sls View File

file.absent file.absent
{% endfor %} {% endfor %}


{% if pillar.get('nginx', {}).get('use_upstart', true) %}
{% set logger_types = ('access', 'error') %} {% set logger_types = ('access', 'error') %}


{% for log_type in logger_types %} {% for log_type in logger_types %}
/etc/logrotate.d/nginx: /etc/logrotate.d/nginx:
file: file:
- absent - absent
{% endif %}


/etc/nginx: /etc/nginx:
file.directory: file.directory:

+ 8
- 2
nginx/package.sls View File


{% set use_upstart = pillar.get('nginx', {}).get('use_upstart', true) %}
{% if use_upstart %}
nginx-old-init: nginx-old-init:
file: file:
- rename - rename
- module: nginx-old-init - module: nginx-old-init
- watch: - watch:
- file: nginx-old-init - file: nginx-old-init
{% endif %}


nginx: nginx:
pkg.installed: pkg.installed:
- name: nginx - name: nginx
{% if use_upstart %}
file: file:
- managed - managed
- name: /etc/init/nginx.conf - name: /etc/init/nginx.conf
- pkg: nginx - pkg: nginx
- file: nginx-old-init - file: nginx-old-init
- module: nginx-old-init - module: nginx-old-init
{% endif %}
service: service:
- running - running
- enable: True - enable: True
- restart: True - restart: True
- watch: - watch:
{% if use_upstart %}
- file: nginx - file: nginx
{% endif %}
- file: /etc/nginx/nginx.conf - file: /etc/nginx/nginx.conf
- file: /etc/nginx/conf.d/default.conf - file: /etc/nginx/conf.d/default.conf
- file: /etc/nginx/conf.d/example_ssl.conf - file: /etc/nginx/conf.d/example_ssl.conf
- pkg: nginx
- pkg: nginx

+ 1
- 0
pillar.example View File

nginx: nginx:
install_from_source: True install_from_source: True
use_upstart: True
with_luajit: False with_luajit: False
with_openresty: True with_openresty: True
modules: modules:

Loading…
Cancel
Save