Mercurial > code > home > repos > infra
comparison packages.py @ 13:d0ca4e569009
upgrade ubuntu on bang
author | drewp@bigasterisk.com |
---|---|
date | Sat, 13 Nov 2021 12:13:10 -0800 |
parents | 15c5ce7c74b5 |
children | ebcc782fabb8 |
comparison
equal
deleted
inserted
replaced
12:15c5ce7c74b5 | 13:d0ca4e569009 |
---|---|
1 from pyinfra import host | 1 from pyinfra import host |
2 from pyinfra.facts.server import LinuxDistribution | 2 from pyinfra.facts.server import LinuxDistribution |
3 from pyinfra.operations import apt, files, ssh | 3 from pyinfra.operations import apt, files, ssh |
4 | 4 |
5 bang_is_old = True # remove after upgrade | |
6 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'] |
7 is_wifi_pi = host.name in ['frontdoor', 'living'] | 6 is_wifi_pi = host.name in ['frontdoor', 'living'] |
8 | 7 |
9 if not is_pi: | 8 if not is_pi: |
10 apt.key(keyserver='keyserver.ubuntu.com', keyid='8B48AD6246925553') | 9 apt.key(keyserver='keyserver.ubuntu.com', keyid='8B48AD6246925553') |
16 apt.packages(update=True, packages=['dirmngr', 'gnupg2', 'apt-utils']) | 15 apt.packages(update=True, packages=['dirmngr', 'gnupg2', 'apt-utils']) |
17 | 16 |
18 apt.key(src='https://ftp-master.debian.org/keys/archive-key-8.asc') | 17 apt.key(src='https://ftp-master.debian.org/keys/archive-key-8.asc') |
19 apt.key(src='https://ftp-master.debian.org/keys/archive-key-8-security.asc') | 18 apt.key(src='https://ftp-master.debian.org/keys/archive-key-8-security.asc') |
20 apt.key(src='https://ftp-master.debian.org/keys/archive-key-9-security.asc') | 19 apt.key(src='https://ftp-master.debian.org/keys/archive-key-9-security.asc') |
20 apt.key(keyserver='keyserver.ubuntu.com', keyid='04EE7237B7D453EC') | |
21 apt.key(keyserver='keyserver.ubuntu.com', keyid='648ACFD622F3D138') | |
21 | 22 |
22 files.file(path='/etc/apt/sources.list.d/raspi.list', present=False) | 23 files.file(path='/etc/apt/sources.list.d/raspi.list', present=False) |
23 | 24 |
24 if is_wifi_pi: | 25 if is_wifi_pi: |
25 files.put(dest="/etc/network/interfaces.d/wlan0", src="files/pi_wlan0_powersave") | 26 files.put(dest="/etc/network/interfaces.d/wlan0", src="files/pi_wlan0_powersave") |
55 'python3-pip', | 56 'python3-pip', |
56 'python3-virtualenv', | 57 'python3-virtualenv', |
57 'sysstat', | 58 'sysstat', |
58 ]) | 59 ]) |
59 | 60 |
60 if not is_pi and not bang_is_old: | 61 if not is_pi and not (host.name == 'prime'): |
61 apt.packages(packages='mlocate', present=False) | 62 apt.packages(packages='mlocate', present=False) |
62 apt.packages(packages='plocate') | 63 apt.packages(packages='plocate') |
63 | 64 |
64 if host.name == "bang": | 65 if host.name == "bang": |
65 apt.packages(packages=[ | 66 apt.packages(packages=[ |
66 'libzfs2linux', | |
67 'zfsutils-linux', | 67 'zfsutils-linux', |
68 'zfs-zed', | 68 'zfs-zed', |
69 'zfs-auto-snapshot', | 69 'zfs-auto-snapshot', |
70 ]) | 70 ]) |