浏览代码

feat(add purge option): purge sites option

tags/v2.4.0
fthenard 4 年前
父节点
当前提交
a373bdab79
共有 3 个文件被更改,包括 6 次插入0 次删除
  1. +1
    -0
      nginx/map.jinja
  2. +2
    -0
      nginx/servers_config.sls
  3. +3
    -0
      pillar.example

+ 1
- 0
nginx/map.jinja 查看文件

@@ -162,6 +162,7 @@
'makedirs': True,
},
'managed': {},
'purge_servers_config': False,
},
'passenger': {
'passenger_root': '/usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini',

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

@@ -83,6 +83,7 @@ nginx_server_enabled_dir:
file.directory:
{{ sls_block(nginx.servers.dir_opts) }}
- name: {{ nginx.lookup.server_enabled }}
- clean: {{ nginx.servers.purge_servers_config }}

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

# Manage the actual server files

+ 3
- 0
pillar.example 查看文件

@@ -174,6 +174,9 @@ nginx:
# partially exposes file.directory params for site available/enabled and
# snippets dirs
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


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

正在加载...
取消
保存