diff --git a/bin/get_gpg_keys.sh b/bin/get_gpg_keys.sh new file mode 100755 index 0000000..d4ec7ad --- /dev/null +++ b/bin/get_gpg_keys.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +# Imports the other admins' plus the salt master/syndic's GPG keys into the +# local keyring, and opens the trust menu in order to trust them ultimately + +RECIPIENTS=( $(egrep '^\s*0x' encrypted_pillar_recipients) ) +SALTMASTER_KEYS_PATH="salt/profile/salt/files/etc/salt/gpgkeys" + +for key in $(ls $SALTMASTER_KEYS_PATH); do + gpg --import ${SALTMASTER_KEYS_PATH}/${key} +done + +for recipient in ${RECIPIENTS[@]}; do + gpg --recv-key $recipient + gpg --edit-key $recipient trust save +done