refactor: store runtime files in run/

This commit is contained in:
Александр Степченко 2023-10-24 12:23:45 +03:00
parent 482f4a6960
commit 39ce3ab65e

View File

@ -100,14 +100,14 @@ def main():
vm_ip_worker1 = get_vm_ip(proxmox, node, vm_id_worker1)
vm_ip_worker2 = get_vm_ip(proxmox, node, vm_id_worker2)
with open('vm_ids' ,'w') as ofile:
with open('run/vm_ids' ,'w') as ofile:
vm_ids = f'{vm_id_master}\t{vm_names["master"]}\n'
vm_ids += f'{vm_id_worker1}\t{vm_names["worker1"]}\n'
vm_ids += f'{vm_id_worker2}\t{vm_names["worker2"]}\n'
logger.info(vm_ids)
ofile.write(vm_ids)
with open('hosts' ,'w') as ofile:
with open('run/hosts' ,'w') as ofile:
hosts = f'{vm_ip_master}\t{vm_names["master"]}\n'
hosts += f'{vm_ip_worker1}\t{vm_names["worker1"]}\n'
hosts += f'{vm_ip_worker2}\t{vm_names["worker2"]}\n'