Move .conf files into Configurations/ folder
master.conf, host1.conf, host2.conf relocated from repo root to Configurations/. load_config.sh updated to source from the new path — no other scripts need changes. Note: sparse checkout rules on HOST1 and HOST2 need updating to use Configurations/host1.conf and Configurations/host2.conf respectively.
This commit is contained in:
+8
-8
@@ -23,7 +23,7 @@
|
|||||||
# auto-discovers it on next git pull. Zero script changes required. Ever.
|
# auto-discovers it on next git pull. Zero script changes required. Ever.
|
||||||
#
|
#
|
||||||
# ── ADDING A NEW SERVER ───────────────────────────────────────────────────────────────────────
|
# ── ADDING A NEW SERVER ───────────────────────────────────────────────────────────────────────
|
||||||
# 1. Create host3.conf following the same structure as HOST1/HOST2
|
# 1. Create Configurations/host3.conf following the same structure as HOST1/HOST2
|
||||||
# 2. Commit and push to git repo
|
# 2. Commit and push to git repo
|
||||||
# 3. All servers pull it automatically — no other changes needed
|
# 3. All servers pull it automatically — no other changes needed
|
||||||
#
|
#
|
||||||
@@ -41,10 +41,10 @@
|
|||||||
#
|
#
|
||||||
# ── SPARSE CHECKOUT NOTE ──────────────────────────────────────────────────────────────────────
|
# ── SPARSE CHECKOUT NOTE ──────────────────────────────────────────────────────────────────────
|
||||||
# Sparse checkout controls which host*.conf files each server receives.
|
# Sparse checkout controls which host*.conf files each server receives.
|
||||||
# HOST1 only pulls host1.conf — never HOST2's credentials.
|
# HOST1 only pulls Configurations/host1.conf — never HOST2's credentials.
|
||||||
# HOST2 only pulls host2.conf — never HOST1's credentials.
|
# HOST2 only pulls Configurations/host2.conf — never HOST1's credentials.
|
||||||
# This loader sources whatever conf files ARE present — sparse checkout handles the rest.
|
# This loader sources whatever conf files ARE present — sparse checkout handles the rest.
|
||||||
# Both servers pull all non-credential conf files (master.conf, common.sh, load_config.sh).
|
# Both servers pull all non-credential conf files (Configurations/master.conf, common.sh, load_config.sh).
|
||||||
#
|
#
|
||||||
# ==============================================================================================
|
# ==============================================================================================
|
||||||
|
|
||||||
@@ -56,12 +56,12 @@
|
|||||||
# ━━━ Source shared config ━━━
|
# ━━━ Source shared config ━━━
|
||||||
# master.conf must be sourced first — it declares the shared PROFILE_* arrays
|
# master.conf must be sourced first — it declares the shared PROFILE_* arrays
|
||||||
# that Host confs extend. Sourcing host confs before master.conf would fail.
|
# that Host confs extend. Sourcing host confs before master.conf would fail.
|
||||||
if [[ ! -f "$LOAD_CONFIG_DIR/master.conf" ]]; then
|
if [[ ! -f "$LOAD_CONFIG_DIR/Configurations/master.conf" ]]; then
|
||||||
echo "[FATAL] master.conf not found at $LOAD_CONFIG_DIR/master.conf" >&2
|
echo "[FATAL] master.conf not found at $LOAD_CONFIG_DIR/Configurations/master.conf" >&2
|
||||||
echo "[FATAL] Check TARGET_DIR and git pull status" >&2
|
echo "[FATAL] Check TARGET_DIR and git pull status" >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
source "$LOAD_CONFIG_DIR/master.conf"
|
source "$LOAD_CONFIG_DIR/Configurations/master.conf"
|
||||||
|
|
||||||
# ━━━ Auto-discover and source all host*.conf files ━━━
|
# ━━━ Auto-discover and source all host*.conf files ━━━
|
||||||
# Sorted for consistent load order — HOST1 before HOST2 before HOST3 etc.
|
# Sorted for consistent load order — HOST1 before HOST2 before HOST3 etc.
|
||||||
@@ -70,7 +70,7 @@
|
|||||||
# At least one host conf must be present or the ecosystem has no identity to work with.
|
# At least one host conf must be present or the ecosystem has no identity to work with.
|
||||||
_host_confs_loaded=0
|
_host_confs_loaded=0
|
||||||
|
|
||||||
for _conf in $(ls "$LOAD_CONFIG_DIR"/host*.conf 2>/dev/null | sort); do
|
for _conf in $(ls "$LOAD_CONFIG_DIR/Configurations"/host*.conf 2>/dev/null | sort); do
|
||||||
if [[ -f "$_conf" ]]; then
|
if [[ -f "$_conf" ]]; then
|
||||||
source "$_conf"
|
source "$_conf"
|
||||||
(( _host_confs_loaded++ ))
|
(( _host_confs_loaded++ ))
|
||||||
|
|||||||
Reference in New Issue
Block a user