Move pyinfra-* libraries into lib/

This commit is contained in:
link2xt 2023-05-26 20:35:50 +00:00
commit 619e1463f1
3 changed files with 30 additions and 0 deletions

View file

@ -0,0 +1 @@
from .nginx import deploy_nginx

23
pyinfra_nginx/nginx.py Normal file
View file

@ -0,0 +1,23 @@
"""
nginx deploy
"""
from io import StringIO
from pyinfra import host
from pyinfra.api.deploy import deploy
from pyinfra.operations import files, server, apt
from pyinfra.facts.deb import DebPackages
def _install_nginx():
if not host.get_fact(DebPackages):
raise DeployError(("Can't deploy prerequisites on non-deb system"))
apt.packages(
name = "Install nginx-extras",
packages = ["nginx-extras"],
_sudo = True,
)
@deploy("Deploy nginx")
def deploy_nginx():
_install_nginx()

6
pyproject.toml Normal file
View file

@ -0,0 +1,6 @@
[build-system]
requires = ["setuptools>=45"]
build-backend = "setuptools.build_meta"
[project]
name = "pyinfra-mailcow"