Commit cdf3fef5 authored by Markus Frosch's avatar Markus Frosch

root: Add root_password_hash parameter and ensure the password

parent 4eb57a57
Pipeline #175 passed with stage
in 43 seconds
class icinga_admin( class icinga_admin(
$users = {}, $users = {},
$groups = {}, $groups = {},
$root_password_hash = undef,
) { ) {
validate_hash($users) validate_hash($users)
validate_hash($groups) validate_hash($groups)
......
...@@ -15,4 +15,15 @@ class icinga_admin::root ...@@ -15,4 +15,15 @@ class icinga_admin::root
ensure => file, ensure => file,
content => template('icinga_admin/bashrc.erb'); content => template('icinga_admin/bashrc.erb');
} }
if $::icinga_admin::root_password_hash {
validate_string($::icinga_admin::root_password_hash)
unless $::icinga_admin::root_password_hash =~ /^\$6\$.+\$.+/ {
fail('You can only use sha512 salt-hashed passwords for "root_password_hash"!')
}
user { 'root':
password => $::icinga_admin::root_password_hash,
}
}
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment