]> gitweb.fluxo.info Git - puppet-bootstrap.git/commitdiff
Fail on empty variables
authorSilvio Rhatto <rhatto@riseup.net>
Thu, 6 Mar 2014 16:14:39 +0000 (13:14 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Thu, 6 Mar 2014 16:14:39 +0000 (13:14 -0300)
TODO.md
manifests/bootstrap/configurator.pp

diff --git a/TODO.md b/TODO.md
index 49bdab75497c2b3c75c859452dfd631a1507af48..a8de25f798d06229a410f25cf887223101aef0d7 100644 (file)
--- a/TODO.md
+++ b/TODO.md
@@ -3,6 +3,5 @@ TODO
 
 * Make `config` target:
   * Check if already ran.
-  * Fail on empty variables.
 * Node templates:
   * Update to new nodo style (hiera and nodo::role).
index 18175a3dc36cf07023032d3e6997c9d6eb5390be..d93a0ceef9af0100323a9533d9a4994e0fcbd180 100644 (file)
@@ -15,16 +15,40 @@ $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
 #