comparison system.py @ 69:659e4b228909

new host 'pipe'
author drewp@bigasterisk.com
date Sat, 11 Jun 2022 22:51:20 -0700
parents a949704defd0
children 1ac08aba5ae5
comparison
equal deleted inserted replaced
68:4a28a6b26af4 69:659e4b228909
31 # 31 #
32 32
33 fstab_file = f'files/fstab/{host.name}' 33 fstab_file = f'files/fstab/{host.name}'
34 if os.path.exists(fstab_file): 34 if os.path.exists(fstab_file):
35 files.put(src=fstab_file, dest='/etc/fstab') 35 files.put(src=fstab_file, dest='/etc/fstab')
36 if is_pi: 36 if is_pi and host.name != 'pipe':
37 for line in [ 37 for line in [
38 'tmpfs /var/log tmpfs defaults,noatime,mode=0755 0 0', 38 'tmpfs /var/log tmpfs defaults,noatime,mode=0755 0 0',
39 'tmpfs /tmp tmpfs defaults,noatime 0 0', 39 'tmpfs /tmp tmpfs defaults,noatime 0 0',
40 ]: 40 ]:
41 files.line(path="/etc/fstab", line=line, replace=line) 41 files.line(path="/etc/fstab", line=line, replace=line)
58 58
59 files.line(path='/etc/ssh/sshd_config', line="^UseDNS\b", replace="UseDNS no") 59 files.line(path='/etc/ssh/sshd_config', line="^UseDNS\b", replace="UseDNS no")
60 systemd.service(service='sshd', reloaded=True) 60 systemd.service(service='sshd', reloaded=True)
61 61
62 62
63 if host.name == 'bang': 63 if host.name in ['bang', 'pipe']:
64 server.shell(commands=['systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target']) 64 server.shell(commands=['systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target'])
65 65
66 if host.name == 'bang':
66 apt.packages(packages=['nfs-kernel-server']) 67 apt.packages(packages=['nfs-kernel-server'])
67 files.template(src='templates/bang_exports.j2', dest='/etc/exports') 68 files.template(src='templates/bang_exports.j2', dest='/etc/exports')
68 69
69 # sudo zfs set sharenfs="rw=10.5.0.0/16" stor6 70 # sudo zfs set sharenfs="rw=10.5.0.0/16" stor6
70 71