Mercurial > code > home > repos > infra
annotate ssh.py @ 305:58d8e6072dcc
update syncthing
author | drewp@bigasterisk.com |
---|---|
date | Sat, 24 Aug 2024 15:06:51 -0700 |
parents | 65e28d2e0cd8 |
children | 5b88b38f2471 |
rev | line source |
---|---|
12 | 1 from pyinfra import host |
2 from pyinfra.facts.server import LinuxDistribution | |
3 from pyinfra.operations import files, systemd | |
4 | |
5 | |
6 systemd.service( | |
7 service='ssh', | |
8 running=True, | |
9 enabled=True, | |
10 ) | |
11 | |
12 files.line(path='/etc/ssh/ssh_config', line="HashKnownHosts", replace="HashKnownHosts no") | |
13 | |
289
65e28d2e0cd8
move static templates to files/ ; use inventory tags for selecting hosts+features ; other refactors
drewp@bigasterisk.com
parents:
278
diff
changeset
|
14 if 'pi' not in host.groups: |
98
3d4340fbb16c
finish moving these lines from system.py
drewp@bigasterisk.com
parents:
12
diff
changeset
|
15 files.line(path='/etc/ssh/sshd_config', line="^UseDNS\b", replace="UseDNS no") |
237 | 16 # MAYBE plus needs this fix: adding ListenAddress 0.0.0.0 to /etc/ssh/sshd_config |
98
3d4340fbb16c
finish moving these lines from system.py
drewp@bigasterisk.com
parents:
12
diff
changeset
|
17 systemd.service(service='sshd', reloaded=True) |