Browse Source

Merge pull request #263 from Irsute/master

feat(add a purge dir option): add the option to purge sites-enable / …
tags/v2.4.0
Imran Iqbal 4 years ago
parent
commit
07a4bc3e73
No account linked to committer's email address
3 changed files with 6 additions and 0 deletions
  1. +1
    -0
      nginx/map.jinja
  2. +2
    -0
      nginx/servers_config.sls
  3. +3
    -0
      pillar.example

+ 1
- 0
nginx/map.jinja View File

'makedirs': True, 'makedirs': True,
}, },
'managed': {}, 'managed': {},
'purge_servers_config': False,
}, },
'passenger': { 'passenger': {
'passenger_root': '/usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini', 'passenger_root': '/usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini',

+ 2
- 0
nginx/servers_config.sls View File

file.directory: file.directory:
{{ sls_block(nginx.servers.dir_opts) }} {{ sls_block(nginx.servers.dir_opts) }}
- name: {{ nginx.lookup.server_enabled }} - name: {{ nginx.lookup.server_enabled }}
- clean: {{ nginx.servers.purge_servers_config }}


# If enabled and available are not the same, create available # If enabled and available are not the same, create available
{% if nginx.lookup.server_enabled != nginx.lookup.server_available -%} {% if nginx.lookup.server_enabled != nginx.lookup.server_available -%}
file.directory: file.directory:
{{ sls_block(nginx.servers.dir_opts) }} {{ sls_block(nginx.servers.dir_opts) }}
- name: {{ nginx.lookup.server_available }} - name: {{ nginx.lookup.server_available }}
- clean: {{ nginx.servers.purge_servers_config }}
{%- endif %} {%- endif %}


# Manage the actual server files # Manage the actual server files

+ 3
- 0
pillar.example View File

# partially exposes file.directory params for site available/enabled and # partially exposes file.directory params for site available/enabled and
# snippets dirs # snippets dirs
dir_opts: {} dir_opts: {}
# let the choice to purge site-available and site-enable folders before add new ones
# (if True it removes all non-salt-managed files)
purge_servers_config: false




##################### #####################

Loading…
Cancel
Save