Browse Source

move upstart-related states to their own file

tags/v0.55.0
Travis J Parker 10 years ago
parent
commit
0da43d9861
3 changed files with 31 additions and 32 deletions
  1. +0
    -32
      nginx/common.sls
  2. +3
    -0
      nginx/init.sls
  3. +28
    -0
      nginx/upstart.sls

+ 0
- 32
nginx/common.sls View File

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


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

{% for log_type in logger_types %}
/var/log/nginx/{{ log_type }}.log:
file.absent

nginx-logger-{{ log_type }}:
file:
- managed
- name: /etc/init/nginx-logger-{{ log_type }}.conf
- template: jinja
- user: root
- group: root
- mode: 440
- source: salt://nginx/templates/upstart-logger.jinja
- context:
type: {{ log_type }}
service:
- running
- enable: True
- require:
- file: nginx-logger-{{ log_type }}
- require_in:
- service: nginx
{% endfor %}

/etc/logrotate.d/nginx:
file:
- absent
{% endif %}

/etc/nginx: /etc/nginx:
file.directory: file.directory:
- user: root - user: root

+ 3
- 0
nginx/init.sls View File

include: include:
- nginx.common - nginx.common
{% if pillar.get('nginx', {}).get('use_upstart', true) %}
- nginx.upstart
{% endif %}
{% if pillar.get('nginx', {}).get('user_auth_enabled', true) %} {% if pillar.get('nginx', {}).get('user_auth_enabled', true) %}
- nginx.users - nginx.users
{% endif %} {% endif %}

+ 28
- 0
nginx/upstart.sls View File

{% set logger_types = ('access', 'error') %}

{% for log_type in logger_types %}
/var/log/nginx/{{ log_type }}.log:
file.absent

nginx-logger-{{ log_type }}:
file:
- managed
- name: /etc/init/nginx-logger-{{ log_type }}.conf
- template: jinja
- user: root
- group: root
- mode: 440
- source: salt://nginx/templates/upstart-logger.jinja
- context:
type: {{ log_type }}
service:
- running
- enable: True
- require:
- file: nginx-logger-{{ log_type }}
- require_in:
- service: nginx
{% endfor %}

/etc/logrotate.d/nginx:
file.absent

Loading…
Cancel
Save