diff manifests/templates.pp @ 246:c3fa3d65aa83

Update configs for Puppet 6 This *should* all be backward compatible
author IBBoard <dev@ibboard.co.uk>
date Sat, 21 Dec 2019 14:19:47 -0500
parents 7d8e664ebcc9
children 308f69ca988c
line wrap: on
line diff
--- a/manifests/templates.pp	Sat Dec 21 14:12:10 2019 -0500
+++ b/manifests/templates.pp	Sat Dec 21 14:19:47 2019 -0500
@@ -2,12 +2,15 @@
 YumRepo<| |> -> Package<| |>
 
 # Make sure all files are in  place before starting services
-File<| |> -> Service<| |>
+File<| tag != 'post-service' |> -> Service<| |>
+
+# Set some shortcut variables
+#$os = $operatingsystem
+$osver = $operatingsystemrelease
+$server = ''
 
 
 class basenode {
-	$os = $operatingsystem
-	$osver = "v${operatingsystemrelease}"
 	include sudo
 
 	include defaultusers
@@ -45,7 +48,7 @@
 
 	require repos
 	include basenode
-	include private
+	include privat
 	include dnsresolver
 	include ssh::server
 	include vcs::server
@@ -183,7 +186,9 @@
 
 	file { '/etc/resolv.conf':
 		ensure => present,
-		content => "nameserver 127.0.0.1"
+		content => "nameserver 127.0.0.1",
+		require => Service['named'],
+		tag => 'post-service',
 	}
 }
 
@@ -442,7 +447,7 @@
 
 	#Setup MySQL, using (private) templates to make sure that we set non-std passwords and a default user
 
-	if $operatingsystem == 'CentOS' and versioncmp($operatingsystemrelease, 7) >= 0 {
+	if $operatingsystem == 'CentOS' and versioncmp($operatingsystemrelease, '7') >= 0 {
 		$mysqlpackage = 'mariadb'
 		$mysqlsuffix = ''
 
@@ -495,8 +500,8 @@
 	apache::mod {
 		$mods:;
 	}
-	if $operatingsystem == 'CentOS' and versioncmp($operatingsystemrelease, 7) >= 0 {
-		apache::mod { 
+	if $operatingsystem == 'CentOS' and versioncmp($operatingsystemrelease, '7') >= 0 {
+		apache::mod {
 			'authn_core':;
 		}
 	}
@@ -508,7 +513,7 @@
 	#Configure our sites, using templates for the custom fragments where the extra content is too long
 	include adminsite
 	website::https::multitld { 'www.ibboard':
-		custom_fragment => template("private/apache/ibboard.fragment"),
+		custom_fragment => template("privat/apache/ibboard.fragment"),
 		letsencrypt_name => 'ibboard.co.uk',
 		csp_override => {
 			"report-uri" => "https://ibboard.report-uri.com/r/d/csp/enforce",
@@ -537,7 +542,7 @@
 	website::https::multitld { 'admin.ibboard':
 		force_no_index => false,
 		ssl_ca_chain => '',
-		custom_fragment => template("private/apache/admin.fragment"),
+		custom_fragment => template("privat/apache/admin.fragment"),
 	}
 	cron { 'loadavg':
 		command => '/usr/local/bin/run-loadavg-logger',
@@ -556,15 +561,15 @@
 	website::https::multitld { 'www.hiveworldterra':
 		force_no_www => false,
 		letsencrypt_name => 'hiveworldterra.co.uk',
-		custom_fragment => template("private/apache/hwt.fragment"),
+		custom_fragment => template("privat/apache/hwt.fragment"),
 	}
 	website::https::multitld { 'forums.hiveworldterra': 
 		letsencrypt_name => 'hiveworldterra.co.uk',
-		custom_fragment => template("private/apache/forums.fragment"),
+		custom_fragment => template("privat/apache/forums.fragment"),
 	}
 	website::https::multitld { 'skins.hiveworldterra':
 		letsencrypt_name => 'hiveworldterra.co.uk',
-		custom_fragment => template("private/apache/skins.fragment"),
+		custom_fragment => template("privat/apache/skins.fragment"),
 	}
 	website::https::redir { 'hiveworldterra.ibboard.co.uk':
 		redir => 'https://www.hiveworldterra.co.uk/',
@@ -578,7 +583,7 @@
 		docroot_owner => $defaultusers::secondary_user,
 		docroot_group => 'editors',
 		letsencrypt_name => 'bdstrike.co.uk',
-		custom_fragment => template("private/apache/bdstrike.fragment"),
+		custom_fragment => template("privat/apache/bdstrike.fragment"),
 		csp_override => {"frame-ancestors" => "'self'"},
 		csp_report_override => {
 			"font-src" => "'self' https://fonts.gstatic.com/",
@@ -629,14 +634,14 @@
 
 	website::https::multitld { 'www.warfoundry':
 		letsencrypt_name => 'warfoundry.co.uk',
-		custom_fragment => template("private/apache/warfoundry.fragment"),
+		custom_fragment => template("privat/apache/warfoundry.fragment"),
 	}
 	website::https::multitld { 'dev.ibboard':
 		#Make sure we're the first one hit for the tiny fraction of "no support" cases we care about (potentially Python for Mercurial!)
 		# http://en.wikipedia.org/wiki/Server_Name_Indication#No_support
 		priority => 1,
 		letsencrypt_name => 'dev.ibboard.co.uk',
-		custom_fragment => template("private/apache/dev.fragment"),
+		custom_fragment => template("privat/apache/dev.fragment"),
 		force_no_index => false,
 	}
 }
@@ -646,7 +651,7 @@
 	website::https { 'webmail.ibboard.co.uk':
 		force_no_index => false,
 		ssl_ca_chain => '',
-		custom_fragment => template("private/apache/webmail.fragment"),
+		custom_fragment => template("privat/apache/webmail.fragment"),
 	}
 	website::https { 'pim.ibboard.co.uk':
 		docroot_owner => 'apache',
@@ -654,7 +659,7 @@
 		force_no_index => false,
 		lockdown_requests => false,
 		ssl_ca_chain => '',
-		custom_fragment => template("private/apache/pim.fragment"),
+		custom_fragment => template("privat/apache/pim.fragment"),
 	}
 	cron { 'owncloudcron':
 		command => "/usr/local/bin/owncloud-cron",