refactor: prefix has a PROXMOX_USER

This commit is contained in:
Александр Степченко 2023-10-24 12:22:52 +03:00
parent 4af20f91a2
commit 482f4a6960

View File

@ -18,7 +18,8 @@ logger.setLevel(logging.DEBUG)
PROXMOX_HOST = 'pve.office.basealt.ru'
PROXMOX_USER = 'stepchenkoas@BaseALT'
PROXMOX_USER = 'stepchenkoas'
PROXMOX_USER_FULL = PROXMOX_USER + '@BaseALT'
PROXMOX_PASSWORD = Path('pve_secret').read_text().strip()
@ -32,14 +33,14 @@ def wait_status(funcs: List[Callable], status: str):
def main():
proxmox = ProxmoxAPI(
PROXMOX_HOST, user=PROXMOX_USER, password=PROXMOX_PASSWORD, verify_ssl=False
PROXMOX_HOST, user=PROXMOX_USER_FULL, password=PROXMOX_PASSWORD, verify_ssl=False
)
nodes = proxmox.nodes.get()
nodes = list(filter(lambda node: node['status'] == 'online', nodes))
node = min(nodes, key=lambda node: node['disk'])['node']
template_id = 374
prefix = 'stepchenkaos-test-k8s'
prefix = PROXMOX_USER + '-test-k8s'
vm_names = {
'master': f'{prefix}-master',
'worker1': f'{prefix}-node1',