forked from khuedoan/homelab
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.py
executable file
·41 lines (29 loc) · 990 Bytes
/
configure.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/usr/bin/python
# WIP
# clean this up
"""
Basic configure script for new users
"""
import os
import platform
import sys
editor = os.getenv('EDITOR')
seed_repo = "github.com/khuedoan/homelab"
domain = "khuedoan.com"
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 = str(input(f"Text editor ({editor}): ") or editor)
# Replace seed repo
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 = 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 use var for inventory
# TODO change Terraform workspace
# TODO switch to git lib
os.system("git diff")