diff --git a/manifests/init.pp b/manifests/init.pp index 1b4fe15f..a8417742 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -597,12 +597,18 @@ default => 'pcs host auth', } + # Check that all nodes have an authorization token + $auth_check_command = $quorum_members.map |$node| { + "grep '${node}' /var/lib/pcsd/tokens" + }.join(' && ') + # Attempt to authorize all members. The command will return successfully # if they were already authenticated so it's safe to run every time this # is applied. # TODO - make it run only once exec { 'authorize_members': command => "${pcs_auth_command} ${node_string} ${auth_credential_string}", + unless => $auth_check_command, path => $exec_path, require => [ Service['pcsd'],