-
-
Notifications
You must be signed in to change notification settings - Fork 878
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
nginx::resource::config define which adds arbitrary configs to conf.d
- Loading branch information
Udo Waechter
committed
Aug 14, 2013
1 parent
204fc54
commit 05ec889
Showing
2 changed files
with
14 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
define nginx::resource::config ($ensure = 'present', $config) { | ||
include nginx::params | ||
validate_hash($config) | ||
|
||
file { "${nginx::params::nx_conf_dir}/conf.d/${name}.conf": | ||
content => template('nginx/conf.d/config.erb'), | ||
ensure => $ensure, | ||
notify => Service['nginx'], | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
### PUPPET MANAGED ### | ||
<% @config.each_pair do |key,value| -%> | ||
<%= key %> <%= value %>; | ||
This comment has been minimized.
Sorry, something went wrong. |
||
<% end -%> |
1 comment
on commit 05ec889
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
THIS SO MUCH!!!!
So, something I've been fighting with when using this pattern.... when to wrap
value
in quotes or not. Otherwise you end up with some ugly hash patterns that may be double-quoted (e.g.:'"variable"'
). Any thoughts here?