mirror of
https://github.com/khuedoan/homelab.git
synced 2025-01-08 14:33:52 +07:00
Forget nodes from know host
This commit is contained in:
parent
5f09306593
commit
f87a915c1c
@ -49,12 +49,17 @@ def wake(node):
|
|||||||
print(f"Waking up {node['name']}")
|
print(f"Waking up {node['name']}")
|
||||||
os.system(f"wol {node['mac']}")
|
os.system(f"wol {node['mac']}")
|
||||||
|
|
||||||
|
def forget(node):
|
||||||
|
os.system(f"ssh-keygen -R {node['ip']}")
|
||||||
|
os.system(f"ssh-keygen -R {node['hostname']}")
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
os.chdir(f"./infra/pxe-server")
|
os.chdir(f"./infra/pxe-server")
|
||||||
os.system(f"docker-compose up -d --build")
|
os.system(f"docker-compose up -d --build")
|
||||||
|
|
||||||
for node in nodes:
|
for node in nodes:
|
||||||
poweroff(node)
|
poweroff(node)
|
||||||
|
forget(node)
|
||||||
|
|
||||||
time.sleep(10)
|
time.sleep(10)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user