Browse Source

Overwrite existing vhost files on a per vhost granularity

tags/v0.55.0
George Robinson 8 years ago
parent
commit
241d8683ed
3 changed files with 2 additions and 8 deletions
  1. +0
    -7
      nginx/ng/map.jinja
  2. +1
    -1
      nginx/ng/vhosts_config.sls
  3. +1
    -0
      pillar.example

+ 0
- 7
nginx/ng/map.jinja View File

@@ -14,7 +14,6 @@
'vhost_available': '/etc/nginx/sites-available',
'vhost_enabled': '/etc/nginx/sites-enabled',
'vhost_use_symlink': True,
'vhost_overwrite': True,
'pid_file': '/run/nginx.pid',
},
'CentOS': {
@@ -25,7 +24,6 @@
'vhost_available': '/etc/nginx/conf.d',
'vhost_enabled': '/etc/nginx/conf.d',
'vhost_use_symlink': False,
'vhost_overwrite': True,
'pid_file': '/run/nginx.pid',
'rh_os_releasever': '$releasever',
'gpg_check': False,
@@ -39,7 +37,6 @@
'vhost_available': '/etc/nginx/conf.d',
'vhost_enabled': '/etc/nginx/conf.d',
'vhost_use_symlink': False,
'vhost_overwrite': True,
'pid_file': '/run/nginx.pid',
'rh_os_releasever': '$releasever',
'gpg_check': False,
@@ -53,7 +50,6 @@
'vhost_available': '/etc/nginx/conf.d',
'vhost_enabled': '/etc/nginx/conf.d',
'vhost_use_symlink': False,
'vhost_overwrite': True,
'pid_file': '/run/nginx.pid',
'gpg_check': True,
'gpg_key': 'http://download.opensuse.org/repositories/server:/http/openSUSE_13.2/repodata/repomd.xml.key'
@@ -66,7 +62,6 @@
'vhost_available': '/etc/nginx/sites-available',
'vhost_enabled': '/etc/nginx/sites-enabled',
'vhost_use_symlink': True,
'vhost_overwrite': True,
},
'Gentoo': {
'package': 'www-servers/nginx',
@@ -76,7 +71,6 @@
'vhost_available': '/etc/nginx/sites-available',
'vhost_enabled': '/etc/nginx/sites-enabled',
'vhost_use_symlink': True,
'vhost_overwrite': True,
},
}, default='Debian' ),
'install_from_source': False,
@@ -87,7 +81,6 @@
'source_hash': '8ed647c3dd65bc4ced03b0e0f6bf9e633eff6b01bac772bcf97077d58bc2be4d',
'source': {
'opts': {},
'modules': {}
},
'package': {
'opts': {},

+ 1
- 1
nginx/ng/vhosts_config.sls View File

@@ -94,7 +94,7 @@ nginx_vhost_available_dir:
- template: jinja
- context:
config: {{ settings.config|json() }}
{% if nginx.lookup.vhost_overwrite == False %}
{% if 'overwrite' in vhost and vhost.overwrite == False %}
- unless:
- test -e {{ vhost_curpath(vhost) }}
{% endif %}

+ 1
- 0
pillar.example View File

@@ -90,6 +90,7 @@ nginx:
enabled_dir: /tmp/sites-enabled # an alternate directory (not sites-enabled) where this vhost may be found
disabled_name: mysite.aint_on # an alternative disabled name to be use when not symlinking
enabled: True
overwrite: True # overwrite an existing vhost file or not
# May be a list of config options or None, if None, no vhost file will be managed/templated
# Take server directives as lists of dictionaries. If the dictionary value is another list of

Loading…
Cancel
Save