Browse Source

Change states to use short-dec style

tags/v0.55.0
Seth House 10 years ago
parent
commit
137482d175
1 changed files with 6 additions and 12 deletions
  1. +6
    -12
      nginx/package.sls

+ 6
- 12
nginx/package.sls View File

{% set use_upstart = salt['pillar.get']('nginx:use_upstart', nginx['use_upstart']) %} {% set use_upstart = salt['pillar.get']('nginx:use_upstart', nginx['use_upstart']) %}
{% if use_upstart %} {% if use_upstart %}
nginx-old-init: nginx-old-init:
file:
- rename
file.rename:
- name: /usr/share/nginx/init.d - name: /usr/share/nginx/init.d
- source: /etc/init.d/nginx - source: /etc/init.d/nginx
- require_in: - require_in:
- force: True - force: True
{% if grains.get('os_family') == 'Debian' %} {% if grains.get('os_family') == 'Debian' %}
# Don't dpkg-divert if we are not Debian based! # Don't dpkg-divert if we are not Debian based!
cmd:
- wait
cmd.wait:
- name: dpkg-divert --divert /usr/share/nginx/init.d --add /etc/init.d/nginx - name: dpkg-divert --divert /usr/share/nginx/init.d --add /etc/init.d/nginx
- require: - require:
- module: nginx-old-init - module: nginx-old-init
- require_in: - require_in:
- file: nginx - file: nginx
{% endif %} {% endif %}
module:
- wait
module.wait:
- name: cmd.run - name: cmd.run
- cmd: kill `cat /var/run/nginx.pid` - cmd: kill `cat /var/run/nginx.pid`
- watch: - watch:
{% endif %} {% endif %}


nginx-old-init-disable: nginx-old-init-disable:
cmd:
- run
cmd.run:
- name: {{ nginx.old_init_disable }} - name: {{ nginx.old_init_disable }}
- require{{ _in }}: - require{{ _in }}:
- module: nginx-old-init - module: nginx-old-init
pkg.installed: pkg.installed:
- name: {{ nginx.package }} - name: {{ nginx.package }}
{% if use_upstart %} {% if use_upstart %}
file:
- managed
file.managed:
- name: /etc/init/nginx.conf - name: /etc/init/nginx.conf
- template: jinja - template: jinja
- user: root - user: root
- file: nginx-old-init - file: nginx-old-init
- module: nginx-old-init - module: nginx-old-init
{% endif %} {% endif %}
service:
- running
service.running:
- enable: True - enable: True
- restart: True - restart: True
- watch: - watch:

Loading…
Cancel
Save