mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 17:22:49 +01:00
ensure socore:socore ownership
This commit is contained in:
@@ -272,6 +272,15 @@ function deleteMinionFiles () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Create the minion file
|
# Create the minion file
|
||||||
|
function ensure_socore_ownership() {
|
||||||
|
log "INFO" "Setting socore ownership on minion files"
|
||||||
|
chown -R socore:socore /opt/so/saltstack/local/pillar/minions/
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
log "ERROR" "Failed to set socore ownership on minion files"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
function create_minion_files() {
|
function create_minion_files() {
|
||||||
mkdir -p /opt/so/saltstack/local/pillar/minions
|
mkdir -p /opt/so/saltstack/local/pillar/minions
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
@@ -292,6 +301,9 @@ function create_minion_files() {
|
|||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Set proper ownership after file creation
|
||||||
|
ensure_socore_ownership || return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
# Add Elastic settings to the minion file
|
# Add Elastic settings to the minion file
|
||||||
@@ -996,6 +1008,9 @@ function setupMinionFiles() {
|
|||||||
# Create node-specific configuration
|
# Create node-specific configuration
|
||||||
create$NODETYPE || return 1
|
create$NODETYPE || return 1
|
||||||
|
|
||||||
|
# Ensure proper ownership after all content is written
|
||||||
|
ensure_socore_ownership || return 1
|
||||||
|
|
||||||
log "INFO" "Successfully created minion files for $MINION_ID"
|
log "INFO" "Successfully created minion files for $MINION_ID"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user