Skip to content

Instantly share code, notes, and snippets.

@meatherly
Created May 14, 2014 21:27
Show Gist options
  • Save meatherly/6e9de6c1254bec8c01db to your computer and use it in GitHub Desktop.
Save meatherly/6e9de6c1254bec8c01db to your computer and use it in GitHub Desktop.
Learning templates
class profile::web {
#vars
$app_name = hiera('webserver::app_name', undef)
$sanitized_app_name = regsubst($app_name, ' ', '-', 'G')
$sites_available_conf = "${nginx::config::nx_conf_dir}/sites-available/${sanitized_app_name}.conf"
$sites_enabled_conf = "${nginx::config::nx_conf_dir}/sites-enabled/${sanitized_app_name}.conf"
class { 'nginx':
conf_template => "profile/web/nginx.conf.erb",
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment