This commit is contained in:
Benoit 2025-02-15 00:36:02 +09:00
parent fb79c80830
commit b663cff493
2 changed files with 4 additions and 4 deletions

View file

@ -1,7 +1,7 @@
from pyinfra import host from pyinfra import host
from pyinfra.operations import apt, server, files, systemd from pyinfra.operations import apt, server, files, systemd
from pyinfra.facts.files import Directory
SUDO = True from pyinfra.facts.systemd import SystemdEnabled
#server.user( #server.user(
# name='Add user benpro', # name='Add user benpro',
@ -70,7 +70,7 @@ files.put(
mode='400', 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( server.shell(
name='Add certificate', name='Add certificate',
commands=[ commands=[
@ -124,7 +124,7 @@ server.shell(
commands=['setcap \'CAP_NET_BIND_SERVICE=+eip CAP_NET_RAW=+eip\' AdGuardHome/AdGuardHome'], 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( server.shell(
name='Install Adguard systemd service file', name='Install Adguard systemd service file',
chdir=host.data.app_dir, chdir=host.data.app_dir,

Binary file not shown.