Mercurial > code > home > repos > infra
comparison net.py @ 283:0befc8696a07
ws
author | drewp@bigasterisk.com |
---|---|
date | Mon, 15 Apr 2024 02:28:05 -0700 |
parents | 4e424a144183 |
children | 73ec5064da44 |
comparison
equal
deleted
inserted
replaced
282:e10ee3ddadcf | 283:0befc8696a07 |
---|---|
2 from pyinfra.operations import apt, files, server, systemd | 2 from pyinfra.operations import apt, files, server, systemd |
3 from pyinfra.facts.server import Arch, LinuxDistribution | 3 from pyinfra.facts.server import Arch, LinuxDistribution |
4 | 4 |
5 is_pi = host.get_fact(LinuxDistribution)['name'] in ['Debian', 'Raspbian GNU/Linux'] | 5 is_pi = host.get_fact(LinuxDistribution)['name'] in ['Debian', 'Raspbian GNU/Linux'] |
6 is_wifi = False | 6 is_wifi = False |
7 | |
7 | 8 |
8 def cleanup(): | 9 def cleanup(): |
9 # past attempts | 10 # past attempts |
10 files.file(path='/etc/network/interfaces', present=False) | 11 files.file(path='/etc/network/interfaces', present=False) |
11 | 12 |
94 src="templates/net/singlenic.network.j2", | 95 src="templates/net/singlenic.network.j2", |
95 dest="/etc/systemd/network/20-bigasterisk.network", | 96 dest="/etc/systemd/network/20-bigasterisk.network", |
96 create_remote_dir=True, | 97 create_remote_dir=True, |
97 ) | 98 ) |
98 apt.packages(packages=['network-manager'], present=False) | 99 apt.packages(packages=['network-manager'], present=False) |
99 | 100 |
100 systemd.service(service='systemd-networkd.service', enabled=True, running=True, restarted=True) | 101 systemd.service(service='systemd-networkd.service', enabled=True, running=True, restarted=True) |
101 | 102 |
102 # delete? | 103 # delete? |
103 # # TODO this breaks wg on garage, i think. workaround: | 104 # # TODO this breaks wg on garage, i think. workaround: |
104 # if host.name == 'garage': | 105 # if host.name == 'garage': |