mirror of
https://github.com/dredx/prole.git
synced 2026-09-23 11:03:59 +00:00
Rename env config files from conf/*/prole.cfg to conf/k3d.cfg, conf/k3s.cfg, and conf/gke.cfg. Update shell/Python loaders and etc/deploy scripts to resolve named configs cleanly while keeping legacy fallback behavior. Align k3s Ansible tasks, docs, and regression coverage with the new configuration layout. Co-authored-by: Junie <junie@jetbrains.com>
34 lines
916 B
Python
34 lines
916 B
Python
#!/usr/bin/env python3
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
# Add project root to path
|
|
ROOT_DIR = Path(__file__).resolve().parents[1]
|
|
sys.path.append(str(ROOT_DIR))
|
|
|
|
from knoe import config as inst_config
|
|
|
|
|
|
def main():
|
|
vault_path = (
|
|
ROOT_DIR
|
|
/ "infrastructure"
|
|
/ "inventory"
|
|
/ "group_vars"
|
|
/ "all"
|
|
/ "vault_k3s.yml"
|
|
)
|
|
token = inst_config._try_read_ansible_vault_value(vault_path, "vault_k3s_token")
|
|
|
|
if token:
|
|
print("Syncing K3S_TOKEN to active config...")
|
|
inst_config._update_prole_cfg_value("Global", "PROLE_K3S_TOKEN", token)
|
|
inst_config._update_prole_cfg_value("Inputs", "init_cluster.k3s_token", token)
|
|
inst_config._update_prole_cfg_value("Service Cluster (k3s)", "K3S_TOKEN", token)
|
|
else:
|
|
print("Warning: Could not extract vault_k3s_token from Ansible vault.")
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|