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.api import deploy
|
||||||
|
from pyinfra.facts.files import File
|
||||||
from pyinfra.operations import apt
|
from pyinfra.operations import apt
|
||||||
from pyinfra.operations import server
|
from pyinfra.operations import server
|
||||||
|
|
||||||
|
|
||||||
@deploy
|
@deploy
|
||||||
def deploy_tailscale():
|
def deploy_tailscale():
|
||||||
server.shell(
|
if not host.get_fact(File, "/usr/share/keyrings/tailscale-archive-keyring.gpg"):
|
||||||
name="Install tailscale signing key",
|
server.shell(
|
||||||
commands=[
|
name="Install tailscale signing key",
|
||||||
"curl -fsSL https://pkgs.tailscale.com/stable/debian/bookworm.noarmor.gpg "
|
commands=[
|
||||||
"| tee /usr/share/keyrings/tailscale-archive-keyring.gpg >/dev/null 2>&1",
|
"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(
|
apt.repo(
|
||||||
name="Add tailscale repository",
|
name="Add tailscale repository",
|
||||||
src="deb [signed-by=/usr/share/keyrings/tailscale-archive-keyring.gpg] "
|
src="deb [signed-by=/usr/share/keyrings/tailscale-archive-keyring.gpg] "
|
||||||
|
|
Loading…
Reference in a new issue