diff --git a/deploy.py b/deploy.py index 22fd3d9..382472d 100644 --- a/deploy.py +++ b/deploy.py @@ -1,7 +1,7 @@ from pyinfra import host from pyinfra.operations import apt, server, files, systemd - -SUDO = True +from pyinfra.facts.files import Directory +from pyinfra.facts.systemd import SystemdEnabled #server.user( # name='Add user benpro', @@ -70,7 +70,7 @@ files.put( mode='400', ) -if not host.fact.directory('/etc/letsencrypt/live/dns.benpro.fr'): +if not host.get_fact(Directory, '/etc/letsencrypt/live/dns.benpro.fr'): server.shell( name='Add certificate', commands=[ @@ -124,7 +124,7 @@ server.shell( commands=['setcap \'CAP_NET_BIND_SERVICE=+eip CAP_NET_RAW=+eip\' AdGuardHome/AdGuardHome'], ) -if host.fact.systemd_enabled['AdGuardHome.service'] == False: +if host.get_fact(SystemdEnabled)['AdGuardHome.service'] == False: server.shell( name='Install Adguard systemd service file', chdir=host.data.app_dir, diff --git a/files/AdGuardHome.yaml b/files/AdGuardHome.yaml index fc62bd6..34daba6 100644 Binary files a/files/AdGuardHome.yaml and b/files/AdGuardHome.yaml differ