pyinfra/tasks/tailscale.py
2024-04-25 15:31:13 +02:00

22 lines
716 B
Python

from pyinfra.api import deploy
from pyinfra.operations import server, apt
@deploy
def deploy_tailscale():
server.shell(
name="Install tailscale signing key",
commands=["curl -fsSL https://pkgs.tailscale.com/stable/debian/bookworm.noarmor.gpg "
"| tee /usr/share/keyrings/tailscale-archive-keyring.gpg >/dev/null 2>&1"]
)
apt.repo(
name="Add tailscale repository",
src="deb [signed-by=/usr/share/keyrings/tailscale-archive-keyring.gpg] "
"https://pkgs.tailscale.com/stable/debian bookworm main",
filename="tailscale"
)
apt.packages(
name="Install tailscale",
packages=["tailscale"],
update=True
)