diff options
-rw-r--r-- | TODO.md | 1 | ||||
-rw-r--r-- | manifests/bootstrap/configurator.pp | 34 |
2 files changed, 29 insertions, 6 deletions
@@ -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). 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": |