diff ssh.py @ 326:5b88b38f2471

huge reorg, reog toplevel functions in preparation of a ui with nice task lists
author drewp@bigasterisk.com
date Mon, 20 Jan 2025 21:55:08 -0800
parents 65e28d2e0cd8
children
line wrap: on
line diff
--- a/ssh.py	Mon Jan 20 14:10:19 2025 -0800
+++ b/ssh.py	Mon Jan 20 21:55:08 2025 -0800
@@ -1,17 +1,3 @@
-from pyinfra import host
+from pyinfra.context import host
 from pyinfra.facts.server import LinuxDistribution
 from pyinfra.operations import files, systemd
-
-
-systemd.service(
-    service='ssh',
-    running=True,
-    enabled=True,
-)
-
-files.line(path='/etc/ssh/ssh_config', line="HashKnownHosts", replace="HashKnownHosts no")
-
-if 'pi' not in host.groups:
-    files.line(path='/etc/ssh/sshd_config', line="^UseDNS\b", replace="UseDNS no")
-    # MAYBE plus needs this fix: adding ListenAddress 0.0.0.0 to /etc/ssh/sshd_config
-    systemd.service(service='sshd', reloaded=True)