aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Fandrich <danf@mageia.org>2024-10-05 16:09:13 -0700
committerDan Fandrich <danf@mageia.org>2024-10-05 16:39:54 -0700
commita7797c331e1fa86bdef5c49d6870d822dc591217 (patch)
treeab13b66e6f59511f98c5973ecbff36af876b57cc
parent9d1a749d073a5997cd435ac51c5c65eb050b2af5 (diff)
downloadpuppet-a7797c331e1fa86bdef5c49d6870d822dc591217.tar
puppet-a7797c331e1fa86bdef5c49d6870d822dc591217.tar.gz
puppet-a7797c331e1fa86bdef5c49d6870d822dc591217.tar.bz2
puppet-a7797c331e1fa86bdef5c49d6870d822dc591217.tar.xz
puppet-a7797c331e1fa86bdef5c49d6870d822dc591217.zip
Use @ when accessing variables in templates
Access without the @ symbol is the older method and is discouraged. This take leaves alone accesses of variables that are defined within the template, which don't seem to allow an @. This batch of changes is for templates related to web sites.
-rw-r--r--deployment/websites/templates/vhost_meetbot.conf4
-rw-r--r--deployment/websites/templates/vhost_static.conf4
-rw-r--r--deployment/wikis/templates/wiki_settings2
-rw-r--r--deployment/wikis/templates/wiki_vhost.conf8
-rw-r--r--modules/apache/templates/01_default_ssl_vhost.conf10
-rw-r--r--modules/apache/templates/django.wsgi4
-rw-r--r--modules/apache/templates/mod/php.conf4
-rw-r--r--modules/apache/templates/vhost_base.conf30
-rw-r--r--modules/apache/templates/vhost_django_app.conf2
-rw-r--r--modules/apache/templates/vhost_fcgid.conf6
-rw-r--r--modules/apache/templates/vhost_redirect.conf2
-rw-r--r--modules/apache/templates/vhost_reverse_proxy.conf8
-rw-r--r--modules/apache/templates/vhost_simple.conf4
-rw-r--r--modules/apache/templates/vhost_ssl.conf12
-rw-r--r--modules/apache/templates/vhost_ssl_redirect.conf2
-rw-r--r--modules/apache/templates/vhost_wsgi.conf2
-rw-r--r--modules/mediawiki/templates/LocalSettings.php42
-rw-r--r--modules/mediawiki/templates/wiki_vhost.conf4
18 files changed, 75 insertions, 75 deletions
diff --git a/deployment/websites/templates/vhost_meetbot.conf b/deployment/websites/templates/vhost_meetbot.conf
index a6f812c5..40a0f92a 100644
--- a/deployment/websites/templates/vhost_meetbot.conf
+++ b/deployment/websites/templates/vhost_meetbot.conf
@@ -1,6 +1,6 @@
<VirtualHost *:80>
ServerAdmin sysadm@mageia.org
- ServerName meetbot.<%= domain %>
+ ServerName meetbot.<%= @domain %>
DocumentRoot <%= scope.lookupvar("websites::meetbot::vhostdir") %>
CustomLog /var/log/httpd/access_meetbot_log combined
@@ -17,7 +17,7 @@
<VirtualHost *:443>
ServerAdmin sysadm@mageia.org
- ServerName meetbot.<%= domain %>
+ ServerName meetbot.<%= @domain %>
DocumentRoot <%= scope.lookupvar("websites::meetbot::vhostdir") %>
CustomLog /var/log/httpd/access_meetbot_log combined
diff --git a/deployment/websites/templates/vhost_static.conf b/deployment/websites/templates/vhost_static.conf
index d250a712..fcadc425 100644
--- a/deployment/websites/templates/vhost_static.conf
+++ b/deployment/websites/templates/vhost_static.conf
@@ -1,5 +1,5 @@
<VirtualHost *:80>
- ServerName static.<%= domain %>
+ ServerName static.<%= @domain %>
DocumentRoot <%= scope.lookupvar("websites::static::vhostdir") %>
CustomLog /var/log/httpd/static_log combined
@@ -40,7 +40,7 @@
</VirtualHost>
<VirtualHost *:443>
- ServerName static.<%= domain %>
+ ServerName static.<%= @domain %>
DocumentRoot <%= scope.lookupvar("websites::static::vhostdir") %>
CustomLog /var/log/httpd/static_log combined
diff --git a/deployment/wikis/templates/wiki_settings b/deployment/wikis/templates/wiki_settings
index 16d9245d..ec6e647d 100644
--- a/deployment/wikis/templates/wiki_settings
+++ b/deployment/wikis/templates/wiki_settings
@@ -13,7 +13,7 @@ $wgScriptPath = "/mw-$wgLanguageCode";
$wgArticlePath = "/$wgLanguageCode/$1";
$wgUsePathInfo = true;
$wgStylePath = "$wgScriptPath/skins";
-$wgStyleDirectory = '<%= wikis_templates %>/skins';
+$wgStyleDirectory = '<%= @wikis_templates %>/skins';
$wgLogo = "";
$wgDefaultSkin = 'vector';
$wgFavicon = '/mw-en/skins/cavendish/favicon.png';
diff --git a/deployment/wikis/templates/wiki_vhost.conf b/deployment/wikis/templates/wiki_vhost.conf
index d4e5e0a2..077de211 100644
--- a/deployment/wikis/templates/wiki_vhost.conf
+++ b/deployment/wikis/templates/wiki_vhost.conf
@@ -1,4 +1,4 @@
-<Directory <%= wikis_root %>>
+<Directory <%= @wikis_root %>>
Options +FollowSymLinks
</Directory>
@@ -7,11 +7,11 @@ RewriteRule ^/?$ /en/ [R]
<%- for lang in wiki_languages -%>
-<Directory <%= wikis_root %>/<%= lang %>/images>
+<Directory <%= @wikis_root %>/<%= lang %>/images>
SetHandler default-handler
</Directory>
-Alias /<%= lang %> <%= wikis_root %>/<%= lang %>/index.php
-Alias /mw-<%= lang %> <%= wikis_root %>/<%= lang %>
+Alias /<%= lang %> <%= @wikis_root %>/<%= lang %>/index.php
+Alias /mw-<%= lang %> <%= @wikis_root %>/<%= lang %>
<%- end -%>
diff --git a/modules/apache/templates/01_default_ssl_vhost.conf b/modules/apache/templates/01_default_ssl_vhost.conf
index c9cdcfcd..323bf145 100644
--- a/modules/apache/templates/01_default_ssl_vhost.conf
+++ b/modules/apache/templates/01_default_ssl_vhost.conf
@@ -15,7 +15,7 @@
# General setup for the virtual host
DocumentRoot "/var/www/html"
#ServerName localhost:443
-ServerAdmin root@<%= domain %>
+ServerAdmin root@<%= @domain %>
ErrorLog logs/ssl_error_log
<IfModule mod_log_config.c>
@@ -38,10 +38,10 @@ SSLCipherSuite ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:EC
# connect. Disable SSLv2/v3 access by default:
SSLProtocol ALL -SSLv2 -SSLv3
-<%- if wildcard_sslcert == 'true' then -%>
-SSLCertificateFile /etc/ssl/wildcard.<%= domain %>.crt
-SSLCertificateKeyFile /etc/ssl/wildcard.<%= domain %>.key
-SSLCACertificateFile /etc/ssl/wildcard.<%= domain %>.pem
+<%- if @wildcard_sslcert == 'true' then -%>
+SSLCertificateFile /etc/ssl/wildcard.<%= @domain %>.crt
+SSLCertificateKeyFile /etc/ssl/wildcard.<%= @domain %>.key
+SSLCACertificateFile /etc/ssl/wildcard.<%= @domain %>.pem
SSLVerifyClient None
<%- else -%>
SSLCertificateFile /etc/ssl/apache/localhost.pem
diff --git a/modules/apache/templates/django.wsgi b/modules/apache/templates/django.wsgi
index aa0b82c8..2188e1e7 100644
--- a/modules/apache/templates/django.wsgi
+++ b/modules/apache/templates/django.wsgi
@@ -6,8 +6,8 @@ if path not in sys.path:
sys.path.append(path)
<%- end -%>
-<%- if django_module -%>
-os.environ['DJANGO_SETTINGS_MODULE'] = '<%= django_module %>.settings'
+<%- if @django_module -%>
+os.environ['DJANGO_SETTINGS_MODULE'] = '<%= @django_module %>.settings'
<%- else -%>
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
<%- end -%>
diff --git a/modules/apache/templates/mod/php.conf b/modules/apache/templates/mod/php.conf
index 6d64ffb8..8bc20078 100644
--- a/modules/apache/templates/mod/php.conf
+++ b/modules/apache/templates/mod/php.conf
@@ -1,5 +1,5 @@
# as php insist to have this value set, let's
# look on the system for him
-php_value date.timezone "<%= php_date_timezone %>"
-php_admin_value sendmail_path "/usr/sbin/sendmail -t -i -f root@<%= domain %>"
+php_value date.timezone "<%= @php_date_timezone %>"
+php_admin_value sendmail_path "/usr/sbin/sendmail -t -i -f root@<%= @domain %>"
diff --git a/modules/apache/templates/vhost_base.conf b/modules/apache/templates/vhost_base.conf
index 84c8f918..da26b683 100644
--- a/modules/apache/templates/vhost_base.conf
+++ b/modules/apache/templates/vhost_base.conf
@@ -1,4 +1,4 @@
-<%- if use_ssl then
+<%- if @use_ssl then
port = 443
else
port = 80
@@ -6,19 +6,19 @@ end
-%>
<VirtualHost *:<%= port %>>
-<%- if use_ssl then -%>
+<%- if @use_ssl then -%>
<%= scope.function_template(["apache/vhost_ssl.conf"]) %>
<%- end -%>
- ServerName <%= real_vhost %>
-<%- server_aliases.each do |key| -%>
+ ServerName <%= @real_vhost %>
+<%- @server_aliases.each do |key| -%>
ServerAlias <%= key %>
<%- end -%>
- DocumentRoot <%= location %>
+ DocumentRoot <%= @location %>
- CustomLog <%= real_access_logfile %> combined
- ErrorLog <%= real_error_logfile %>
+ CustomLog <%= @real_access_logfile %> combined
+ ErrorLog <%= @real_error_logfile %>
-<%- if enable_public_html -%>
+<%- if @enable_public_html -%>
#TODO add the rest
UserDir public_html
<%- else -%>
@@ -27,19 +27,19 @@ end
</IfModule>
<%- end -%>
-<%- aliases.keys.sort {|a,b| a.size <=> b.size }.reverse.each do |key| -%>
- Alias <%= key %> <%= aliases[key] %>
+<%- @aliases.keys.sort {|a,b| a.size <=> b.size }.reverse.each do |key| -%>
+ Alias <%= key %> <%= @aliases[key] %>
<%- end -%>
- <%= content %>
+ <%= @content %>
-<%- if options.length > 0 -%>
- <Directory <%= location %>>
- Options <%= options.join(" ") %>
+<%- if @options.length > 0 -%>
+ <Directory <%= @location %>>
+ Options <%= @options.join(" ") %>
</Directory>
<%- end -%>
-<%- if enable_location -%>
+<%- if @enable_location -%>
<Location />
<IfModule mod_authz_core.c>
Require all granted
diff --git a/modules/apache/templates/vhost_django_app.conf b/modules/apache/templates/vhost_django_app.conf
index 3310045e..d85cf7a9 100644
--- a/modules/apache/templates/vhost_django_app.conf
+++ b/modules/apache/templates/vhost_django_app.conf
@@ -1 +1 @@
-WSGIScriptAlias / /usr/local/lib/wsgi/<%= name %>.wsgi
+WSGIScriptAlias / /usr/local/lib/wsgi/<%= @name %>.wsgi
diff --git a/modules/apache/templates/vhost_fcgid.conf b/modules/apache/templates/vhost_fcgid.conf
index 288b5aa2..b31c2bb3 100644
--- a/modules/apache/templates/vhost_fcgid.conf
+++ b/modules/apache/templates/vhost_fcgid.conf
@@ -1,8 +1,8 @@
AddHandler fcgid-script .pl
-<%- script_aliases.keys.sort {|a,b| a.size <=> b.size }.reverse.each do |key| -%>
- ScriptAlias <%= key %> <%= script_aliases[key] %>
+<%- @script_aliases.keys.sort {|a,b| a.size <=> b.size }.reverse.each do |key| -%>
+ ScriptAlias <%= key %> <%= @script_aliases[key] %>
<%- end -%>
-FcgidMinProcessesPerClass <%= process %>
+FcgidMinProcessesPerClass <%= @process %>
FcgidIdleTimeout 30
# These robots were scraping the whole of svnweb in 2024-04, causing severe
diff --git a/modules/apache/templates/vhost_redirect.conf b/modules/apache/templates/vhost_redirect.conf
index 0f256881..c787311e 100644
--- a/modules/apache/templates/vhost_redirect.conf
+++ b/modules/apache/templates/vhost_redirect.conf
@@ -1,2 +1,2 @@
-Redirect / <%= url %>
+Redirect / <%= @url %>
diff --git a/modules/apache/templates/vhost_reverse_proxy.conf b/modules/apache/templates/vhost_reverse_proxy.conf
index 1488c682..4859bda3 100644
--- a/modules/apache/templates/vhost_reverse_proxy.conf
+++ b/modules/apache/templates/vhost_reverse_proxy.conf
@@ -1,4 +1,4 @@
-<%= content %>
+<%= @content %>
ProxyRequests Off
ProxyPreserveHost On
@@ -7,9 +7,9 @@
Order deny,allow
Allow from all
</Proxy>
-<%- if url =~ /^https/ -%>
+<%- if @url =~ /^https/ -%>
SSLProxyEngine On
<%- end -%>
- ProxyPass / <%= url %>
- ProxyPassReverse / <%= url %>
+ ProxyPass / <%= @url %>
+ ProxyPassReverse / <%= @url %>
diff --git a/modules/apache/templates/vhost_simple.conf b/modules/apache/templates/vhost_simple.conf
index afc443de..77b55287 100644
--- a/modules/apache/templates/vhost_simple.conf
+++ b/modules/apache/templates/vhost_simple.conf
@@ -1,6 +1,6 @@
<VirtualHost *:80>
- ServerName <%= name %>
- DocumentRoot <%= location %>
+ ServerName <%= @name %>
+ DocumentRoot <%= @location %>
<Location />
<IfModule mod_authz_core.c>
diff --git a/modules/apache/templates/vhost_ssl.conf b/modules/apache/templates/vhost_ssl.conf
index e39e6820..0cb52eca 100644
--- a/modules/apache/templates/vhost_ssl.conf
+++ b/modules/apache/templates/vhost_ssl.conf
@@ -2,12 +2,12 @@
SSLProtocol ALL -SSLv2 -SSLv3
SSLHonorCipherOrder On
SSLCipherSuite ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AESGCM:RSA+AES:RSA+3DES:!aNULL:!MD5:!DSS
- <%- if wildcard_sslcert == 'true' then -%>
- SSLCertificateFile /etc/ssl/wildcard.<%= domain %>.crt
- SSLCertificateKeyFile /etc/ssl/wildcard.<%= domain %>.key
- SSLCACertificateFile /etc/ssl/wildcard.<%= domain %>.pem
+ <%- if @wildcard_sslcert == 'true' then -%>
+ SSLCertificateFile /etc/ssl/wildcard.<%= @domain %>.crt
+ SSLCertificateKeyFile /etc/ssl/wildcard.<%= @domain %>.key
+ SSLCACertificateFile /etc/ssl/wildcard.<%= @domain %>.pem
SSLVerifyClient None
<%- else -%>
- SSLCertificateFile /etc/ssl/apache/<%= real_vhost %>.pem
- SSLCertificateKeyFile /etc/ssl/apache/<%= real_vhost %>.pem
+ SSLCertificateFile /etc/ssl/apache/<%= @real_vhost %>.pem
+ SSLCertificateKeyFile /etc/ssl/apache/<%= @real_vhost %>.pem
<%- end -%>
diff --git a/modules/apache/templates/vhost_ssl_redirect.conf b/modules/apache/templates/vhost_ssl_redirect.conf
index d13c3093..23a7eabe 100644
--- a/modules/apache/templates/vhost_ssl_redirect.conf
+++ b/modules/apache/templates/vhost_ssl_redirect.conf
@@ -1 +1 @@
-Redirect / https://<%= name %>/
+Redirect / https://<%= @name %>/
diff --git a/modules/apache/templates/vhost_wsgi.conf b/modules/apache/templates/vhost_wsgi.conf
index 34926411..2f1ba585 100644
--- a/modules/apache/templates/vhost_wsgi.conf
+++ b/modules/apache/templates/vhost_wsgi.conf
@@ -1,3 +1,3 @@
-WSGIScriptAlias / <%= wsgi_path %>
+WSGIScriptAlias / <%= @wsgi_path %>
diff --git a/modules/mediawiki/templates/LocalSettings.php b/modules/mediawiki/templates/LocalSettings.php
index 36b3054f..c340dfd9 100644
--- a/modules/mediawiki/templates/LocalSettings.php
+++ b/modules/mediawiki/templates/LocalSettings.php
@@ -24,7 +24,7 @@ set_include_path( implode( PATH_SEPARATOR, $path ) . PATH_SEPARATOR . get_includ
## Uncomment this to disable output compression
# $wgDisableOutputCompression = true;
-$wgSitename = "<%= title %>";
+$wgSitename = "<%= @title %>";
# $wgMetaNamespace = ""; # Defaults to $wgSitename
## The URL base path to the directory containing the wiki;
@@ -32,7 +32,7 @@ $wgSitename = "<%= title %>";
## For more information on customizing the URLs
## (like /w/index.php/Page_title to /wiki/Page_title) please see:
## https://www.mediawiki.org/wiki/Manual:Short_URL
-$wgScriptPath = "/<%= path %>";
+$wgScriptPath = "/<%= @path %>";
## The protocol and server name to use in fully-qualified URLs
$wgServer = "https://wiki.mageia.org";
@@ -52,8 +52,8 @@ $wgLogo = "$wgStylePath/common/images/wiki_mga.png";
$wgEnableEmail = true;
$wgEnableUserEmail = true; # UPO
-$wgEmergencyContact = "root@<%= domain %>";
-$wgPasswordSender = "wiki_noreply@ml.<%= domain %>";
+$wgEmergencyContact = "root@<%= @domain %>";
+$wgPasswordSender = "wiki_noreply@ml.<%= @domain %>";
$wgEnotifUserTalk = true; # UPO
$wgEnotifWatchlist = true; # UPO
@@ -61,10 +61,10 @@ $wgEmailAuthentication = true;
## Database settings
$wgDBtype = "postgres";
-$wgDBserver = "pg.<%= domain %>";
-$wgDBname = "<%= db_name %>";
-$wgDBuser = "<%= db_user %>";
-$wgDBpassword = "<%= db_password %>";
+$wgDBserver = "pg.<%= @domain %>";
+$wgDBname = "<%= @db_name %>";
+$wgDBuser = "<%= @db_user %>";
+$wgDBpassword = "<%= @db_password %>";
# Postgres specific settings
$wgDBport = "5432";
@@ -97,22 +97,22 @@ $wgShellLocale = "en_US.UTF-8";
# This seems actually mandatory to get the Vector skin to work properly
# https://serverfault.com/a/744059
# FIXME: Dehardcode that path (maybe via ${wiki_root} if exposed?)
-$wgCacheDirectory = "/srv/wiki/<%= path %>/cache";
+$wgCacheDirectory = "/srv/wiki/<%= @path %>/cache";
-$wgUploadDirectory = "/srv/wiki/<%= path %>/images";
+$wgUploadDirectory = "/srv/wiki/<%= @path %>/images";
# This seems mandatory to get the Vector skin to work properly
# https://phabricator.wikimedia.org/T119934
# FIXME: Dehardcode that path (maybe via ${wiki_root} if exposed?)
-$wgTmpDirectory = "/srv/wiki/<%= path %>/tmp";
+$wgTmpDirectory = "/srv/wiki/<%= @path %>/tmp";
# Array of interwiki prefixes for current wiki.
$wgLocalInterwikis = array( strtolower( $wgSitename ) );
# Site language code, should be one of the list in ./languages/data/Names.php
-$wgLanguageCode = "<%= lang %>";
+$wgLanguageCode = "<%= @lang %>";
-$wgSecretKey = "<%= secret_key %>";
+$wgSecretKey = "<%= @secret_key %>";
# Changing this will log out all existing sessions.
$wgAuthenticationTokenVersion = "1";
@@ -180,19 +180,19 @@ $wgLDAPUseLocal = false;
$wgLDAPDomainNames = array( 'ldap' );
# TODO make it workable with more than one server
-$wgLDAPServerNames = array( 'ldap' => 'ldap.<%= domain %>' );
+$wgLDAPServerNames = array( 'ldap' => 'ldap.<%= @domain %>' );
-$wgLDAPSearchStrings = array( 'ldap' => 'uid=USER-NAME,ou=People,<%= dc_suffix %>' );
+$wgLDAPSearchStrings = array( 'ldap' => 'uid=USER-NAME,ou=People,<%= @dc_suffix %>' );
$wgLDAPEncryptionType = array( 'ldap' => 'tls' );
-$wgLDAPBaseDNs = array( 'ldap' => '<%= dc_suffix %>' );
-$wgLDAPUserBaseDNs = array( 'ldap' => 'ou=People,<%= dc_suffix %>' );
-$wgLDAPGroupBaseDNs = array ( 'ldap' => 'ou=Group,<%= dc_suffix %>' );
+$wgLDAPBaseDNs = array( 'ldap' => '<%= @dc_suffix %>' );
+$wgLDAPUserBaseDNs = array( 'ldap' => 'ou=People,<%= @dc_suffix %>' );
+$wgLDAPGroupBaseDNs = array ( 'ldap' => 'ou=Group,<%= @dc_suffix %>' );
-$wgLDAPProxyAgent = array( 'ldap' => 'cn=mediawiki-alamut,ou=System Accounts,<%= dc_suffix %>' );
+$wgLDAPProxyAgent = array( 'ldap' => 'cn=mediawiki-alamut,ou=System Accounts,<%= @dc_suffix %>' );
-$wgLDAPProxyAgentPassword = array( 'ldap' => '<%= ldap_password %>' );
+$wgLDAPProxyAgentPassword = array( 'ldap' => '<%= @ldap_password %>' );
$wgLDAPUseLDAPGroups = array( 'ldap' => true );
$wgLDAPGroupNameAttribute = array( 'ldap' => 'cn' );
@@ -205,4 +205,4 @@ $wgLDAPLowerCaseUsername = array( 'ldap' => true );
$wgLDAPPreferences = array( 'ldap' => array( 'email'=>'mail','realname'=>'cn','nickname'=>'uid','language'=>'preferredlanguage') );
-<%= wiki_settings %>
+<%= @wiki_settings %>
diff --git a/modules/mediawiki/templates/wiki_vhost.conf b/modules/mediawiki/templates/wiki_vhost.conf
index 3fe038c3..1ae3492d 100644
--- a/modules/mediawiki/templates/wiki_vhost.conf
+++ b/modules/mediawiki/templates/wiki_vhost.conf
@@ -1,9 +1,9 @@
# heavily used by the wiki farm stuff
-<Directory <%= root %>>
+<Directory <%= @root %>>
Options +FollowSymLinks
</Directory>
-<Directory <%= root %>/images>
+<Directory <%= @root %>/images>
SetHandler default-handler
</Directory>