aboutsummaryrefslogtreecommitdiff
path: root/manifests
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2014-03-06 13:14:39 -0300
committerSilvio Rhatto <rhatto@riseup.net>2014-03-06 13:14:39 -0300
commitf9e154d36aee29960d5ebe88cd8022cbddc3d203 (patch)
tree65b1cf1bf21445024a1e70c43d78db28089106b4 /manifests
parent4b6fb966e5c18af51456707930233c401d84929b (diff)
downloadpuppet-bootstrap-f9e154d36aee29960d5ebe88cd8022cbddc3d203.tar.gz
puppet-bootstrap-f9e154d36aee29960d5ebe88cd8022cbddc3d203.tar.bz2
Fail on empty variables
Diffstat (limited to 'manifests')
-rw-r--r--manifests/bootstrap/configurator.pp34
1 files changed, 29 insertions, 5 deletions
diff --git a/manifests/bootstrap/configurator.pp b/manifests/bootstrap/configurator.pp
index 18175a3..d93a0ce 100644
--- a/manifests/bootstrap/configurator.pp
+++ b/manifests/bootstrap/configurator.pp
@@ -15,17 +15,41 @@ $templates = "$bootstrap_path/templates"
$base_domain = hiera('bootstrap::base_domain', "${::domain}")
$first_hostname = hiera('bootstrap::first_hostname', "${::hostname}")
$first_nodes = hiera('bootstrap::first_nodes', 'absent')
-$db_password = hiera('nodo::role::master::db_password', 'changeme')
+$db_password = hiera('nodo::role::master::db_password', '')
$mysql_rootpw = hiera('mysql::server::rootpw', '')
-$root_password = hiera('bootstrap::root:password', 'rootpass')
+$root_password = hiera('bootstrap::root::password', '')
$first_user = hiera('bootstrap::first_user', 'user')
-$first_user_password = hiera('bootstrap::first_user::password', 'userpass')
-$first_user_sshkey = hiera('bootstrap::first_user::sshkey', 'usersshkey')
-$first_user_email = hiera('bootstrap::first_user::email', 'usermail')
+$first_user_password = hiera('bootstrap::first_user::password', '')
+$first_user_sshkey = hiera('bootstrap::first_user::sshkey', '')
+$first_user_email = hiera('bootstrap::first_user::email', 'user@example.org')
$resolvconf_nameservers = hiera('nodo::subsystem::resolver::nameservers', '201.6.2.152:201.6.2.32')
$global_munin_allow = hiera('nodo::munin_node::allow', '192.168.0.[0-9]*')
#
+# Check bootstrap configuration
+#
+
+if ($mysql_rootpw == '') {
+ alert('You must set mysql::server::rootpw at your configuration')
+ fail()
+}
+
+if ($db_password == '') {
+ alert('You must set nodo::role::master::db_password at your configuration')
+ fail()
+}
+
+if ($root_password == '') {
+ alert('You must set bootstrap::root::password at your configuration')
+ fail()
+}
+
+if ($first_user_password == '') {
+ alert('You must set bootstrap::first_user::password at your configuration')
+ fail()
+}
+
+#
# Puppet configuration
#
file { "$bootstrap_path/puppet.conf":