33 lines
659 B
Python
33 lines
659 B
Python
from pyinfra import host
|
|
from pyinfra.operations import apt
|
|
|
|
from tasks.docker import deploy_docker
|
|
from tasks.k3s import deploy_k3s
|
|
from tasks.nfs import deploy_nfs
|
|
from tasks.ssh import setup_ssh
|
|
from tasks.tailscale import setup_tailscale
|
|
|
|
apt.packages(
|
|
name="Update and upgrade server",
|
|
update=True,
|
|
upgrade=True,
|
|
)
|
|
|
|
apt.packages(
|
|
name="Install useful packages",
|
|
packages=["htop", "curl", "ufw", "qemu-guest-agent", "nfs-common"],
|
|
)
|
|
|
|
setup_ssh()
|
|
|
|
if host.data.get("docker"):
|
|
deploy_docker()
|
|
|
|
if host.data.get("tailscale"):
|
|
setup_tailscale()
|
|
|
|
if host.data.get("k3s"):
|
|
deploy_k3s()
|
|
|
|
if host.data.get("nfs"):
|
|
deploy_nfs()
|