40 lines
847 B
Python
40 lines
847 B
Python
from pyinfra import host
|
|
from pyinfra.operations import apt
|
|
from pyinfra_docker import deploy_docker
|
|
|
|
from tasks.k3s import setup_k3s
|
|
from tasks.ssh import setup_ssh
|
|
from tasks.tailscale import deploy_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"):
|
|
apt.packages(
|
|
name="Install packages required by Docker",
|
|
packages=[
|
|
"apt-transport-https",
|
|
"ca-certificates",
|
|
"curl",
|
|
"gnupg-agent",
|
|
"software-properties-common",
|
|
],
|
|
)
|
|
|
|
deploy_docker()
|
|
|
|
if host.data.get("tailscale"):
|
|
deploy_tailscale()
|
|
|
|
if host.data.get("k3s"):
|
|
setup_k3s()
|