view multikube_wipe.py @ 178:6ec7cd3615f0

another try at apt.key, but it doesn't completely work because prime would never upgrade nodejs. I didn't try deleting the host key dirs and building from scratch yet.
author drewp@bigasterisk.com
date Sat, 25 Mar 2023 18:43:42 -0700
parents 375515ab60ba
children 3af02e24eaf9
line wrap: on
line source

from pyinfra import host
from pyinfra.operations import server, files

from multikube_config import nodes, server_node

if host.name in nodes + [server_node]:
    files.put(dest='/usr/local/bin/k3s-killall.sh', src='files/kube/k3s-killall.sh', mode='a+rx')
    files.put(dest='/usr/local/bin/k3s-uninstall.sh', src='files/kube/k3s-uninstall.sh', mode='a+rx')
    server.shell(['k3s-uninstall.sh'])
    for n in ['k3s-agent.service', 'k3s-agent.service.env', 'k3s-node.service']:
        files.file(path=f'/etc/systemd/system/{n}', present=False)