Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: modules/adblockplus/manifests/web/static.pp

Issue 29689695: #7320 - Introduce helpcenter role (Closed)
Patch Set: Created Feb. 5, 2018, 5:59 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « hiera/roles/web/helpcenter.yaml ('k') | modules/adblockplus/templates/web/static.conf.erb » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: modules/adblockplus/manifests/web/static.pp
diff --git a/modules/adblockplus/manifests/web/static.pp b/modules/adblockplus/manifests/web/static.pp
new file mode 100644
index 0000000000000000000000000000000000000000..29e485ca7e7398f6540c81bc22cc9433433e1ee0
--- /dev/null
+++ b/modules/adblockplus/manifests/web/static.pp
@@ -0,0 +1,79 @@
+# == Class: adblockplus::web::static
+#
+# Manage a simple Nginx-based webserver for static content
+# that uses a customizable deployment script to e.g. fetch the content
+# from a repository server (ref. http://hub.eyeo.com/issues/4523)
+#
+#
+# === Parameters:
+#
+# [*domain*]
+# The domain name for the website.
+#
+# [*ssl_certificate*]
+# The name of the SSL certificate file within modules/private/files, if any.
+# Requires a private_key as well.
+#
+# [*ssl_private_key*]
+# The name of the private key file within modules/private/files, if any.
+# Requires a certificate as well.
+#
+# [*is_default*]
+# Passed on to nginx (whether or not the site config should be default).
+#
+# [*ensure*]
+# Whether to set up the website or not.
+#
+# === Examples:
+#
+# class {'adblockplus::web::static':
+# domain => 'help.eyeo.com',
+# }
+#
+class adblockplus::web::static (
+ $domain = undef,
+ $ssl_certificate = undef,
+ $ssl_private_key = undef,
+ $is_default = true,
+ $ensure = 'present',
+ $deploy_user = 'web-deploy',
+ $deploy_user_authorized_keys = undef,
+) {
+
+ include adblockplus::web
+ include nginx
+ include geoip
+ include ssh
+
+ file {"/var/www/$domain":
+ ensure => ensure_directory_state($ensure),
+ mode => '0775',
+ owner => www-data,
+ group => www-data,
+ }
+
+ nginx::hostconfig {$title:
+ content => template('adblockplus/web/static.conf.erb'),
+ certificate => $ssl_certificate,
+ domain => $domain,
+ is_default => $is_default,
+ private_key => $ssl_private_key,
+ log => "access_log_$domain",
+ }
+
+ adblockplus::user {$deploy_user:
+ authorized_keys => $deploy_user_authorized_keys,
+ ensure => $ensure,
+ password_hash => '*',
+ shell => '/bin/bash',
+ groups => ['www-data'],
+ }
+
+ file {"/home/$deploy_user/deploy_script.sh":
+ content => template('adblockplus/web/static_deploy_script.sh.erb'),
+ ensure => $ensure,
+ mode => '0755',
+ owner => $deploy_user,
+ }
+
+}
« no previous file with comments | « hiera/roles/web/helpcenter.yaml ('k') | modules/adblockplus/templates/web/static.conf.erb » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld