From 481c3d6aa4833ca249fed77772e657b727ae58c9 Mon Sep 17 00:00:00 2001 From: Imran Haider Date: Sat, 20 Jun 2015 14:18:29 -0400 Subject: [PATCH 1/2] Separate 'dir' into 'available_dir' and 'enabled_dir' --- nginx/ng/vhosts_config.sls | 6 +++--- pillar.example | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/nginx/ng/vhosts_config.sls b/nginx/ng/vhosts_config.sls index 8693fea..fe806a1 100644 --- a/nginx/ng/vhosts_config.sls +++ b/nginx/ng/vhosts_config.sls @@ -23,11 +23,11 @@ # Gets the path of a particular vhost {% macro vhost_path(vhost, state) -%} {%- if state == True -%} - {{ path_join(vhost, nginx.vhosts.managed.get(vhost).get('dir', nginx.lookup.vhost_enabled)) }} + {{ path_join(vhost, nginx.vhosts.managed.get(vhost).get('enabled_dir', nginx.lookup.vhost_enabled)) }} {%- elif state == False -%} - {{ path_join(disabled_name(vhost), nginx.vhosts.managed.get(vhost).get('dir', nginx.lookup.vhost_available)) }} + {{ path_join(disabled_name(vhost), nginx.vhosts.managed.get(vhost).get('available_dir', nginx.lookup.vhost_available)) }} {%- else -%} - {{ path_join(vhost, nginx.vhosts.managed.get(vhost).get('dir', nginx.lookup.vhost_available)) }} + {{ path_join(vhost, nginx.vhosts.managed.get(vhost).get('available_dir', nginx.lookup.vhost_available)) }} {%- endif -%} {%- endmacro %} diff --git a/pillar.example b/pillar.example index c9d810a..384028e 100644 --- a/pillar.example +++ b/pillar.example @@ -74,7 +74,7 @@ nginx: managed: mysite: # relative pathname of the vhost file # may be True, False, or None where True is enabled, False, disabled, and None indicates no action - dir: /tmp # an alternate directory (not sites-available) where this vhost may be found + available_dir: /tmp # an alternate directory (not sites-available) where this vhost may be found disabled_name: mysite.aint_on # an alternative disabled name to be use when not symlinking enabled: True From 36368cae5d2e22388a541f49bdd9e5000b32d35d Mon Sep 17 00:00:00 2001 From: Imran Haider Date: Tue, 23 Jun 2015 20:02:19 -0400 Subject: [PATCH 2/2] Added enabled_dir to pillar.example --- pillar.example | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pillar.example b/pillar.example index 384028e..cfcc078 100644 --- a/pillar.example +++ b/pillar.example @@ -74,7 +74,8 @@ nginx: managed: mysite: # relative pathname of the vhost file # may be True, False, or None where True is enabled, False, disabled, and None indicates no action - available_dir: /tmp # an alternate directory (not sites-available) where this vhost may be found + available_dir: /tmp/sites-available # an alternate directory (not sites-available) where this vhost may be found + enabled_dir: /tmp/sites-enabled # an alternate directory (not sites-available) where this vhost may be found disabled_name: mysite.aint_on # an alternative disabled name to be use when not symlinking enabled: True