diff --git a/deploy.py b/deploy.py index 394c959..20b13d9 100644 --- a/deploy.py +++ b/deploy.py @@ -1,6 +1,7 @@ from pyinfra import host, local from pyinfra.facts import server from pyinfra.operations import files +from pyinfra.operations import server as o_server if host.name == "@local": home = host.get_fact(server.Home) @@ -23,8 +24,27 @@ if host.name != "@local": files.directory(path=f"{home}/.ssh", mode="700") files.put(src="files/authorized_keys", dest=f"{home}/.ssh/authorized_keys") + o_server.user( + name="Create pyinfra user for logs", + user="pyinfra", + home="/home/pyinfra/" + ) + + files.file( + name="Create pyinfra log file", + path="/var/log/pyinfra.log", + user="pyinfra", + group="pyinfra", + mode="644", +# _doas=True, + # _sudo=True, + ) + if host.name == "ararat.0x90.space": local.include("ararat/deploy.py") if host.name == "baixun.0x90.space": local.include("baixun/deploy.py") + +if host.name == "chat.heizhaus.org": + local.include("matrix-synapse/deploy.py")