Mercurial > code > home > repos > infra
annotate packages.py @ 56:4c15fc1e879d
bump some tool versions
author | drewp@bigasterisk.com |
---|---|
date | Wed, 06 Apr 2022 19:22:13 -0700 |
parents | 23c1450eb9a3 |
children | a949704defd0 |
rev | line source |
---|---|
12 | 1 from pyinfra import host |
2 from pyinfra.facts.server import LinuxDistribution | |
49 | 3 from pyinfra.operations import apt, files, ssh, server |
12 | 4 |
5 is_pi = host.get_fact(LinuxDistribution)['name'] in ['Debian', 'Raspbian GNU/Linux'] | |
6 is_wifi_pi = host.name in ['frontdoor', 'living'] | |
7 | |
8 if not is_pi: | |
9 apt.key(keyserver='keyserver.ubuntu.com', keyid='8B48AD6246925553') | |
10 | |
11 if is_pi: | |
12 apt.packages(packages=['mandb', 'apt-listchanges'], present=False) | |
13 files.template(src='templates/pi_sources.list.j2', dest='/etc/apt/sources.list', rel='bullseye') | |
14 # 'apt upgrade'? | |
42 | 15 apt.packages( |
16 update=False, # see system.py | |
17 packages=['dirmngr', 'gnupg2', 'apt-utils']) | |
12 | 18 |
19 apt.key(src='https://ftp-master.debian.org/keys/archive-key-8.asc') | |
20 apt.key(src='https://ftp-master.debian.org/keys/archive-key-8-security.asc') | |
21 apt.key(src='https://ftp-master.debian.org/keys/archive-key-9-security.asc') | |
13 | 22 apt.key(keyserver='keyserver.ubuntu.com', keyid='04EE7237B7D453EC') |
23 apt.key(keyserver='keyserver.ubuntu.com', keyid='648ACFD622F3D138') | |
12 | 24 |
25 files.file(path='/etc/apt/sources.list.d/raspi.list', present=False) | |
26 | |
27 if is_wifi_pi: | |
28 files.put(dest="/etc/network/interfaces.d/wlan0", src="files/pi_wlan0_powersave") | |
29 ssh.command(host.name, "iw wlan0 set power_save off") | |
30 | |
31 files.template(src='templates/boot_config.txt.j2', dest='/boot/config.txt') | |
32 | |
33 if not is_pi and host.name != 'prime': | |
34 apt.key(src='https://dl.google.com/linux/linux_signing_key.pub') | |
35 apt.repo(src='deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main') | |
36 | |
37 apt.key(src='https://packages.microsoft.com/keys/microsoft.asc') | |
38 apt.repo(src="deb [arch=amd64,arm64,armhf] http://packages.microsoft.com/repos/code stable main") | |
39 | |
40 apt.key(keyserver='keyserver.ubuntu.com', keyid='F24AEA9FB05498B7') | |
41 apt.repo(src="deb [arch=amd64,i386] https://repo.steampowered.com/steam/ stable steam") | |
42 | |
43 apt.packages(packages=[ | |
44 'build-essential', | |
45 # 'i2c-tools', | |
46 'rsync', | |
47 'dstat', | |
48 'ifstat', | |
24 | 49 'mosquitto-clients', |
50 'ncdu', | |
42 | 51 "udns-utils", |
56 | 52 "atool", |
12 | 53 ]) |
54 | |
55 if not is_pi: | |
56 apt.packages(packages=[ | |
57 'keychain', | |
58 'python3-docker', | |
59 'python3-invoke', | |
60 'python3-pip', | |
61 'python3-virtualenv', | |
62 'sysstat', | |
24 | 63 'debian-goodies', |
25
16cd19a68832
add lxterminal (because kitty isn't configured yet)
drewp@bigasterisk.com
parents:
24
diff
changeset
|
64 'lxterminal', |
42 | 65 'iotop', |
66 'lpr', | |
56 | 67 'nodejs', |
68 'npm', | |
12 | 69 ]) |
56 | 70 vers = '0.24.4' # see https://github.com/kovidgoyal/kitty/releases |
49 | 71 home = '/home/drewp' |
72 local = f"{home}/.local/kitty" | |
56 | 73 dl = f'/tmp/kitty-{vers}-x86_64.txz' |
49 | 74 files.download(src=f"https://github.com/kovidgoyal/kitty/releases/download/v{vers}/kitty-{vers}-x86_64.txz", |
56 | 75 dest=dl) |
49 | 76 files.makedirs(local, exist_ok=True) |
77 server.shell([ | |
56 | 78 f"mkdir -p {local}", # https://github.com/Fizzadar/pyinfra/issues/777 |
79 f"aunpack --extract-to={local} {dl}", | |
49 | 80 ]) |
81 files.link(target="{local}/bin/kitty", path="{home}/bin/kitty") | |
12 | 82 |
56 | 83 server.shell([ |
84 "npm install -g pnpm@6.32.3", | |
85 ]) | |
86 | |
13 | 87 if not is_pi and not (host.name == 'prime'): |
12 | 88 apt.packages(packages='mlocate', present=False) |
89 apt.packages(packages='plocate') | |
90 | |
91 if host.name == "bang": | |
92 apt.packages(packages=[ | |
34
d4fb38f13c79
refactor dns and some other non-net setup
drewp@bigasterisk.com
parents:
25
diff
changeset
|
93 'iptables', |
d4fb38f13c79
refactor dns and some other non-net setup
drewp@bigasterisk.com
parents:
25
diff
changeset
|
94 'openntpd', |
d4fb38f13c79
refactor dns and some other non-net setup
drewp@bigasterisk.com
parents:
25
diff
changeset
|
95 'ntpdate', |
12 | 96 'zfsutils-linux', |
97 'zfs-zed', | |
98 'zfs-auto-snapshot', | |
99 ]) | |
37
fbd0849dfdbd
redo networking to be much simpler. Uses systemd-networkd
drewp@bigasterisk.com
parents:
34
diff
changeset
|
100 |
fbd0849dfdbd
redo networking to be much simpler. Uses systemd-networkd
drewp@bigasterisk.com
parents:
34
diff
changeset
|
101 if host.name == 'plus': |
42 | 102 apt.packages(packages=['network-manager']) |