changeset 24:204330fea19a puppet-3.6

Use MariaDB on CentOS7 and manage hiera.yaml (to avoid warnings)
author IBBoard <dev@ibboard.co.uk>
date Mon, 09 Mar 2015 00:01:27 +0000
parents aa40b53324e4
children 13adb555a7e2
files hiera.yaml manifests/templates.pp
diffstat 2 files changed, 28 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hiera.yaml	Mon Mar 09 00:01:27 2015 +0000
@@ -0,0 +1,6 @@
+---
+:backends: yaml
+:yaml:
+  :datadir: /var/lib/hiera
+:hierarchy: common
+:logger: console
\ No newline at end of file
--- a/manifests/templates.pp	Sun Mar 08 23:58:22 2015 +0000
+++ b/manifests/templates.pp	Mon Mar 09 00:01:27 2015 +0000
@@ -5,6 +5,16 @@
 
 	include defaultusers
 	include logwatch
+
+	file { '/etc/puppet/hiera.yaml':
+		ensure => present,
+		content => "---
+:backends: yaml
+:yaml:
+  :datadir: /var/lib/hiera
+:hierarchy: common
+:logger: console",
+	}
 }
 
 class basevpsnode (
@@ -223,11 +233,22 @@
 		suffix => '55ibb', #IBBoard's rebuild of Webtatic's PHP 5.5
 		opcache => 'opcache',
 	}
+
 	#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 {
+		$mysqlpackage = 'mariadb'
+		$mysqlsuffix = ''
+	}
+	else {
+		$mysqlpackage = 'mysql'
+		$mysqlsuffix = '55w'
+	}
 	class { 'website::mysql':
 		mysqluser => template('defaultusers/mysql-user'),
 		mysqlpassword => template('defaultusers/mysql-password'),
-		mysqlsuffix => '55w',
+		mysqlprefix => $mysqlpackage,
+		mysqlsuffix => $mysqlsuffix,
 		phpsuffix => '55ibb',
 		phpmysqlsuffix => 'nd'
 	}