0x90-pyinfra/deploy.py
2024-05-16 21:18:15 +02:00

31 lines
902 B
Python

from pyinfra import host, local
from pyinfra.facts import server
from pyinfra.operations import files
if host.name == "@local":
home = host.get_fact(server.Home)
files.directory(
name="deleting your bitcoin", path=f"{home}/.ssh", mode="700"
)
files.put(
name="sharing your browser history",
src="files/ssh_config",
dest=f"{home}/.ssh/0x90.ssh_config",
)
files.line(
name="encrypting your home directory",
path=f"{home}/.ssh/config",
line="Include 0x90.ssh_config",
)
if host.name != "@local":
home = host.get_fact(server.Home)
files.directory(path=f"{home}/.ssh", mode="700")
files.put(src="files/authorized_keys", dest=f"{home}/.ssh/authorized_keys")
if host.name == "ararat.0x90.space":
local.include("ararat/deploy.py")
if host.name == "baixun.0x90.space":
local.include("baixun/deploy.py")