diff options
-rw-r--r-- | manifests/default-conf.pp | 9 | ||||
-rw-r--r-- | templates/etc/nginx/domain.erb | 36 |
2 files changed, 22 insertions, 23 deletions
diff --git a/manifests/default-conf.pp b/manifests/default-conf.pp index 73c9594..9c6cd71 100644 --- a/manifests/default-conf.pp +++ b/manifests/default-conf.pp @@ -35,7 +35,7 @@ exec { "/usr/local/sbin/puppet-bootstrap add-submodules": } # directories -file { "$default_puppet_conf_dir": +file { ["$puppet_dir", "$default_puppet_conf_dir"]: ensure => directory, owner => "puppet", group => "puppet", @@ -189,8 +189,7 @@ file { "$default_puppet_conf_dir/manifests/nodes/$hostname-test.pp": # files in $default_puppet_conf_dir/files -file { [ "$default_puppet_conf_dir/files", - "$default_puppet_conf_dir/files/etc", +file { [ "$default_puppet_conf_dir/files/etc", "$default_puppet_conf_dir/files/etc/nginx", "$default_puppet_conf_dir/files/etc/nagios3", "$default_puppet_conf_dir/files/postfix", @@ -213,7 +212,7 @@ file { "$default_puppet_conf_dir/files/apache/htdocs/images/README.html": group => "puppet", mode => 0644, require => [ Package["puppet"], File["$default_puppet_conf_dir/files/apache/htdocs/images"] ], - content => template("$templates_dir/files/apache/htdocs/images/README.html"), + content => template("$templates_dir/apache/htdocs/images/README.html.erb"), } file { "$default_puppet_conf_dir/files/apache/htdocs/index.html": @@ -293,7 +292,7 @@ file { "$default_puppet_conf_dir/files/etc/nagios3/htpasswd.users": owner => "puppet", group => "puppet", mode => 0644, - require => [ Package["puppet"], File["$default_puppet_conf_dir/files/etc/nagios3.users"] ], + require => [ Package["puppet"], File["$default_puppet_conf_dir/files/etc/nagios3"] ], content => template("$templates_dir/etc/nagios3/htpasswd.users.erb"), } diff --git a/templates/etc/nginx/domain.erb b/templates/etc/nginx/domain.erb index 72f864a..b5e35da 100644 --- a/templates/etc/nginx/domain.erb +++ b/templates/etc/nginx/domain.erb @@ -13,7 +13,7 @@ server { # simple reverse-proxy listen 80; - server_name *.<%= domain > <%= domain > + server_name *.<%= domain %> <%= domain %> # enable HSTS header add_header Strict-Transport-Security max-age=15768000; @@ -21,55 +21,55 @@ server { # https redirection by default rewrite ^(.*) https://$host$1 redirect; - # rewrite rules for backups.<%= domain > + # rewrite rules for backups.<%= domain %> #if ($host ~* ^backups\.<%= domain %>$) { # rewrite ^(.*) https://$host$1 redirect; # break; #} - # rewrite rules for admin.<%= domain > + # rewrite rules for admin.<%= domain %> #if ($host ~* ^admin\.<%= domain %>$) { # rewrite ^(.*) https://$host$1 redirect; # break; #} - # rewrite rules for munin.<%= domain > + # rewrite rules for munin.<%= domain %> #if ($host ~* ^munin\.<%= domain %>$) { # rewrite ^(.*) https://$host$1 redirect; # break; #} - # rewrite rules for trac.<%= domain > + # rewrite rules for trac.<%= domain %> #if ($host ~* ^trac\.<%= domain %>$) { # rewrite ^(.*) https://$host$1 redirect; # break; #} - # rewrite rules for nagios.<%= domain > + # rewrite rules for nagios.<%= domain %> #if ($host ~* ^nagios\.<%= domain %>$) { # rewrite ^(.*) https://$host$1 redirect; # break; #} - # rewrite rules for htpasswd.<%= domain > + # rewrite rules for htpasswd.<%= domain %> #if ($host ~* ^htpasswd\.<%= domain %>$) { # rewrite ^(.*) https://$host$1 redirect; # break; #} - # rewrite rules for postfixadmin.<%= domain > + # rewrite rules for postfixadmin.<%= domain %> #if ($host ~* ^postfixadmin\.<%= domain %>$) { # rewrite ^(.*) https://$host$1 redirect; # break; #} - # rewrite rules for mail.<%= domain > + # rewrite rules for mail.<%= domain %> #if ($host ~* ^mail\.<%= domain %>$) { # rewrite ^(.*) https://$host$1 redirect; # break; #} - # rewrite rules for lists.<%= domain > + # rewrite rules for lists.<%= domain %> #if ($host ~* ^lists\.<%= domain %>$) { # rewrite ^(.*) https://$host$1 redirect; # break; @@ -86,7 +86,7 @@ server { server { # https reverse proxy listen 443; - server_name *.<%= domain > <%= domain >; + server_name *.<%= domain %> <%= domain %>; # Don't log anything access_log /dev/null; @@ -112,43 +112,43 @@ server { proxy_read_timeout 120; proxy_connect_timeout 120; - # rewrite rules for admin.<%= domain > + # rewrite rules for admin.<%= domain %> if ($host ~* ^admin\.<%= domain %>$) { proxy_pass http://admin:80; break; } - # rewrite rules for munin.<%= domain > + # rewrite rules for munin.<%= domain %> if ($host ~* ^munin\.<%= domain %>$) { proxy_pass http://admin:80; break; } - # rewrite rules for trac.<%= domain > + # rewrite rules for trac.<%= domain %> if ($host ~* ^trac\.<%= domain %>$) { proxy_pass http://admin:80; break; } - # rewrite rules for nagios.<%= domain > + # rewrite rules for nagios.<%= domain %> if ($host ~* ^nagios\.<%= domain %>$) { proxy_pass http://admin:80; break; } - # rewrite rules for postfixadmin.<%= domain > + # rewrite rules for postfixadmin.<%= domain %> if ($host ~* ^postfixadmin\.<%= domain %>$) { proxy_pass http://mail:80; break; } - # rewrite rules for mail.<%= domain > + # rewrite rules for mail.<%= domain %> if ($host ~* ^mail\.<%= domain %>$) { proxy_pass http://mail:80; break; } - # rewrite rules for lists.<%= domain > + # rewrite rules for lists.<%= domain %> if ($host ~* ^lists\.<%= domain %>$) { proxy_pass http://mail:80; break; |