commit 619e1463f128431ca1a4b939d73c4cdf2f0c5f51 Author: link2xt Date: Fri May 26 20:35:50 2023 +0000 Move pyinfra-* libraries into lib/ diff --git a/pyinfra_nginx/__init__.py b/pyinfra_nginx/__init__.py new file mode 100644 index 0000000..840daad --- /dev/null +++ b/pyinfra_nginx/__init__.py @@ -0,0 +1 @@ +from .nginx import deploy_nginx diff --git a/pyinfra_nginx/nginx.py b/pyinfra_nginx/nginx.py new file mode 100644 index 0000000..634f13e --- /dev/null +++ b/pyinfra_nginx/nginx.py @@ -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() diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..b2d6cae --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,6 @@ +[build-system] +requires = ["setuptools>=45"] +build-backend = "setuptools.build_meta" + +[project] +name = "pyinfra-mailcow"