From 2add4e94c874bd85b045e12ced2f81c1f90c153b Mon Sep 17 00:00:00 2001 From: Theo Chatzimichos Date: Feb 12 2018 12:09:29 +0000 Subject: [ci-skip] add script that imports/receives and trusts GPG keys locally --- 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