Initial commit

This commit is contained in:
Carlos
2018-09-23 18:55:20 +02:00
commit a41e5bc976
6 changed files with 216 additions and 0 deletions

20
assets/runtime/functions.sh Executable file
View File

@@ -0,0 +1,20 @@
#!/usr/bin/env bash
# This function copies minion keys
function copy_minion_keys()
{
echo "Copying minion keys..."
if [ -d "${SALT_KEYS_DIR}/master" ] && [ ! -z "$(ls -A ${SALT_KEYS_DIR}/master)" ]; then
mkdir -v -p -m 0700 ${SALT_MASTER_DIR}
cp -v ${SALT_KEYS_DIR}/master/master.{pem,pub} ${SALT_MASTER_DIR}
chown -v root:root ${SALT_MASTER_DIR}/master.{pem,pub}
fi
if [ -d "${SALT_KEYS_DIR}/minions" ] && [ ! -z "$(ls -A ${SALT_KEYS_DIR}/minions)" ]; then
mkdir -v -p -m 0700 ${SALT_MASTER_DIR}/minions
cp -v ${SALT_KEYS_DIR}/minions/* ${SALT_MASTER_DIR}/minions
chown -v root:root ${SALT_MASTER_DIR}/minions/*
fi
}