khuedoan-homelab/configure.py

41 lines
960 B
Python
Raw Normal View History

#!/usr/bin/python
# WIP
# clean this up
"""
Basic configure script for new users
"""
2022-01-04 22:27:46 +07:00
import os
import platform
import sys
if sys.version_info < (3, 10, 0):
raise Exception("Must be using Python >= 3.10.0")
if platform.system() != 'Linux':
raise Exception("Only Linux is supported, please us a Linux VM or switch operating system")
# confirm text editor
editor = os.getenv('EDITOR')
editor = str(input(f"Text editor ({editor}): ") or editor)
# Replace seed repo
seed_repo = "github.com/khuedoan/homelab"
seed_repo = str(input(f"Enter seed repo ({seed_repo}): ") or seed_repo)
os.system(f"./scripts/replace-gitops-repo {seed_repo}")
# Replace domain
domain = "khuedoan.com"
domain = str(input(f"Enter your domain ({domain}): ") or domain)
os.system(f"./scripts/replace-domain {domain}")
# change hardware info
os.system(f"{editor} 'metal/inventories/prod.yml'")
# TODO change Terraform workspace
# TODO switch to git lib
os.system("git diff")