After automatic updates via the package maintenance policy

Problem

… the join scripts must be executed on all servers.
You have to login on each server and execute univention-run-join-scripts

Solution

You can user the following Script and execute it like this:
/bin/bash execute-cmd-on-all-ucs-server.sh univention-run-join-scripts -dcaccount Administrator

master:~# cat execute-cmd-on-all-ucs-server.sh

#!/bin/bash
for srv in $(univention-ldapsearch '(|(objectClass=univentionDomainController)(objectClass=univentionMemberserver))' -LLL cn | ldapsearch-decode64 | sed -ne 's|^cn: ||p'); do
        test "$srv" = "$hostname" && continue
        echo "Run $@ on $srv"
        ssh -i ~/.ssh/id_rsa $srv "$@"
        echo
done

Maybe someone has a good idea, how to avoid setting the password on each server for the join.
Or you can define a special Account who is member of “Domain Admin” and store a password file on each server. Than you can use univention-run-join-scripts -dcaccount <Domain Admin Member Account> -dcpwd </somewhere/youStoredThePassword>

1 Like
Mastodon