mirror of
https://github.com/saltstack/salt-bootstrap.git
synced 2025-04-17 10:10:25 +00:00
Merge pull request #26 from techhat/develop
Copy master configuration as well as minion
This commit is contained in:
commit
899636d85a
1 changed files with 14 additions and 0 deletions
|
@ -907,14 +907,18 @@ config_minion() {
|
|||
fi
|
||||
|
||||
PKI_DIR=/etc/salt/pki/minion
|
||||
MASTER_PKI_DIR=/etc/salt/pki/master
|
||||
|
||||
# Let's create the necessary directories
|
||||
[ -d /etc/salt ] || mkdir /etc/salt
|
||||
[ -d $PKI_DIR ] || mkdir -p $PKI_DIR && chmod 700 $PKI_DIR
|
||||
[ -d $MASTER_PKI_DIR ] || mkdir -p $MASTER_PKI_DIR && chmod 700 $MASTER_PKI_DIR
|
||||
|
||||
# Copy the minions configuration if found
|
||||
[ -f "$TEMP_CONFIG_DIR/minion" ] && mv "$TEMP_CONFIG_DIR/minion" /etc/salt
|
||||
|
||||
# Copy the masters configuration if found
|
||||
[ -f "$TEMP_CONFIG_DIR/master" ] && mv "$TEMP_CONFIG_DIR/master" /etc/salt
|
||||
|
||||
# Copy the minion's keys if found
|
||||
if [ -f "$TEMP_CONFIG_DIR/minion.pem" ]; then
|
||||
|
@ -925,6 +929,16 @@ config_minion() {
|
|||
mv "$TEMP_CONFIG_DIR/minion.pub" $PKI_DIR/
|
||||
chmod 664 $PKI_DIR/minion.pub
|
||||
fi
|
||||
|
||||
# Copy the master's keys if found
|
||||
if [ -f "$TEMP_CONFIG_DIR/master.pem" ]; then
|
||||
mv "$TEMP_CONFIG_DIR/master.pem" $MASTER_PKI_DIR/
|
||||
chmod 400 $MASTER_PKI_DIR/master.pem
|
||||
fi
|
||||
if [ -f "$TEMP_CONFIG_DIR/master.pub" ]; then
|
||||
mv "$TEMP_CONFIG_DIR/master.pub" $MASTER_PKI_DIR/
|
||||
chmod 664 $MASTER_PKI_DIR/master.pub
|
||||
fi
|
||||
}
|
||||
#
|
||||
# Ended Default Configuration function
|
||||
|
|
Loading…
Add table
Reference in a new issue