pyinfra/tasks/tailscale.py

26 lines
766 B
Python
Raw Normal View History

2024-04-25 15:31:13 +02:00
from pyinfra.api import deploy
2024-06-08 00:53:33 +02:00
from pyinfra.operations import apt
from pyinfra.operations import server
2024-04-25 15:31:13 +02:00
@deploy
def deploy_tailscale():
server.shell(
name="Install tailscale signing key",
2024-06-08 00:53:33 +02:00
commands=[
"curl -fsSL https://pkgs.tailscale.com/stable/debian/bookworm.noarmor.gpg "
"| tee /usr/share/keyrings/tailscale-archive-keyring.gpg >/dev/null 2>&1",
],
2024-04-25 15:31:13 +02:00
)
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",
2024-06-08 00:53:33 +02:00
filename="tailscale",
2024-04-25 15:31:13 +02:00
)
apt.packages(
name="Install tailscale",
packages=["tailscale"],
2024-06-08 00:53:33 +02:00
update=True,
2024-04-25 15:31:13 +02:00
)