mirror of
https://github.com/dredx/prole.git
synced 2026-09-23 10:13:58 +00:00
25 lines
869 B
Python
25 lines
869 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 installer 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()
|