update tailscale task
This commit is contained in:
parent
d0808a45ad
commit
e76c7a5d55
2 changed files with 10 additions and 7 deletions
0
tasks/__init__.py
Normal file
0
tasks/__init__.py
Normal file
|
@ -1,17 +1,20 @@
|
|||
from pyinfra import host
|
||||
from pyinfra.api import deploy
|
||||
from pyinfra.facts.files import File
|
||||
from pyinfra.operations import apt
|
||||
from pyinfra.operations import server
|
||||
|
||||
|
||||
@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",
|
||||
],
|
||||
)
|
||||
if not host.get_fact(File, "/usr/share/keyrings/tailscale-archive-keyring.gpg"):
|
||||
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] "
|
||||
|
|
Loading…
Reference in a new issue