浏览代码

Merge pull request #15 from tfolio/upstart-optional

Add pillar item to disable using upstart-based services
tags/v0.55.0
Seth House 10 年前
父节点
当前提交
6831d739c1
共有 3 个文件被更改,包括 11 次插入2 次删除
  1. +2
    -0
      nginx/common.sls
  2. +8
    -2
      nginx/package.sls
  3. +1
    -0
      pillar.example

+ 2
- 0
nginx/common.sls 查看文件

@@ -7,6 +7,7 @@
file.absent
{% endfor %}

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

{% for log_type in logger_types %}
@@ -36,6 +37,7 @@ nginx-logger-{{ log_type }}:
/etc/logrotate.d/nginx:
file:
- absent
{% endif %}

/etc/nginx:
file.directory:

+ 8
- 2
nginx/package.sls 查看文件

@@ -1,4 +1,5 @@

{% set use_upstart = pillar.get('nginx', {}).get('use_upstart', true) %}
{% if use_upstart %}
nginx-old-init:
file:
- rename
@@ -32,10 +33,12 @@ nginx-old-init-disable:
- module: nginx-old-init
- watch:
- file: nginx-old-init
{% endif %}

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

+ 1
- 0
pillar.example 查看文件

@@ -1,5 +1,6 @@
nginx:
install_from_source: True
use_upstart: True
with_luajit: False
with_openresty: True
modules:

正在加载...
取消
保存