diff --git a/nginx/ng/map.jinja b/nginx/ng/map.jinja index 70afee7..423987f 100644 --- a/nginx/ng/map.jinja +++ b/nginx/ng/map.jinja @@ -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': {}, diff --git a/nginx/ng/vhosts_config.sls b/nginx/ng/vhosts_config.sls index f51b782..5b422ec 100644 --- a/nginx/ng/vhosts_config.sls +++ b/nginx/ng/vhosts_config.sls @@ -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 %} diff --git a/pillar.example b/pillar.example index 847cdde..bfdc737 100644 --- a/pillar.example +++ b/pillar.example @@ -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