prole/mock_val/sync-prole-cfg.py
chrisfu 4ee2b259c9 Checkpoint: rename installer to knoe + harden db build context
- Add build-context helper to copy Docker context safely (ignore runtime data, keep symlinks)

- Update UI and core actions to use ~/.prole/build and shared copy helper

- Add/adjust tests and scripts; introduce knoe ops helpers and update manifests

Co-authored-by: Junie <junie@jetbrains.com>
2026-03-22 01:45:21 -07:00

34 lines
918 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(f"Syncing K3S_TOKEN to conf/prole.cfg...")
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()