Mercurial > code > home > repos > infra
annotate packages.py @ 74:023741df3298
more pkgs
author | drewp@bigasterisk.com |
---|---|
date | Sat, 11 Jun 2022 22:57:23 -0700 |
parents | f0e59adf7b91 |
children | 41008d412ec8 |
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 | |
69 | 11 if host.name == 'pipe': |
12 apt.packages(packages=['mandb', 'apt-listchanges'], present=False) | |
13 files.template(src='templates/odroid_sources.list.j2', dest='/etc/apt/sources.list', rel='focal') | |
14 | |
15 elif is_pi: | |
12 | 16 apt.packages(packages=['mandb', 'apt-listchanges'], present=False) |
17 files.template(src='templates/pi_sources.list.j2', dest='/etc/apt/sources.list', rel='bullseye') | |
18 # 'apt upgrade'? | |
42 | 19 apt.packages( |
20 update=False, # see system.py | |
74 | 21 packages=['dirmngr', 'gnupg2', 'apt-utils', 'aptitude']) |
12 | 22 |
23 apt.key(src='https://ftp-master.debian.org/keys/archive-key-8.asc') | |
24 apt.key(src='https://ftp-master.debian.org/keys/archive-key-8-security.asc') | |
25 apt.key(src='https://ftp-master.debian.org/keys/archive-key-9-security.asc') | |
13 | 26 apt.key(keyserver='keyserver.ubuntu.com', keyid='04EE7237B7D453EC') |
27 apt.key(keyserver='keyserver.ubuntu.com', keyid='648ACFD622F3D138') | |
12 | 28 |
29 files.file(path='/etc/apt/sources.list.d/raspi.list', present=False) | |
30 | |
31 if is_wifi_pi: | |
32 files.put(dest="/etc/network/interfaces.d/wlan0", src="files/pi_wlan0_powersave") | |
33 ssh.command(host.name, "iw wlan0 set power_save off") | |
34 | |
35 files.template(src='templates/boot_config.txt.j2', dest='/boot/config.txt') | |
36 | |
37 if not is_pi and host.name != 'prime': | |
38 apt.key(src='https://dl.google.com/linux/linux_signing_key.pub') | |
39 apt.repo(src='deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main') | |
40 | |
41 apt.key(src='https://packages.microsoft.com/keys/microsoft.asc') | |
42 apt.repo(src="deb [arch=amd64,arm64,armhf] http://packages.microsoft.com/repos/code stable main") | |
43 | |
44 apt.key(keyserver='keyserver.ubuntu.com', keyid='F24AEA9FB05498B7') | |
45 apt.repo(src="deb [arch=amd64,i386] https://repo.steampowered.com/steam/ stable steam") | |
46 | |
47 apt.packages(packages=[ | |
48 'build-essential', | |
49 # 'i2c-tools', | |
50 'rsync', | |
51 'dstat', | |
52 'ifstat', | |
24 | 53 'mosquitto-clients', |
54 'ncdu', | |
42 | 55 "udns-utils", |
56 | 56 "atool", |
74 | 57 'iproute2', # needed for wireguard |
12 | 58 ]) |
59 | |
60 if not is_pi: | |
61 apt.packages(packages=[ | |
62 'keychain', | |
63 'python3-docker', | |
64 'python3-invoke', | |
65 'python3-pip', | |
66 'python3-virtualenv', | |
67 'sysstat', | |
24 | 68 'debian-goodies', |
25
16cd19a68832
add lxterminal (because kitty isn't configured yet)
drewp@bigasterisk.com
parents:
24
diff
changeset
|
69 'lxterminal', |
42 | 70 'iotop', |
71 'lpr', | |
56 | 72 'nodejs', |
73 'npm', | |
74 | 74 'ethtool', |
75 'speedtest-cli', | |
76 'net-tools', | |
77 'oping', | |
78 'mtr-tiny', | |
79 'tcpdump', | |
12 | 80 ]) |
62 | 81 vers = '0.25.0' # see https://github.com/kovidgoyal/kitty/releases |
49 | 82 home = '/home/drewp' |
83 local = f"{home}/.local/kitty" | |
56 | 84 dl = f'/tmp/kitty-{vers}-x86_64.txz' |
49 | 85 files.download(src=f"https://github.com/kovidgoyal/kitty/releases/download/v{vers}/kitty-{vers}-x86_64.txz", |
56 | 86 dest=dl) |
60 | 87 files.directory(local) |
49 | 88 server.shell([ |
56 | 89 f"mkdir -p {local}", # https://github.com/Fizzadar/pyinfra/issues/777 |
90 f"aunpack --extract-to={local} {dl}", | |
49 | 91 ]) |
92 files.link(target="{local}/bin/kitty", path="{home}/bin/kitty") | |
12 | 93 |
56 | 94 server.shell([ |
62 | 95 # https://github.com/pnpm/pnpm/releases |
96 "npm install -g pnpm@7.0.0", | |
56 | 97 ]) |
98 | |
72
f0e59adf7b91
updates that aren't pkg or version changes
drewp@bigasterisk.com
parents:
69
diff
changeset
|
99 apt.packages(packages='mlocate', present=False) |
f0e59adf7b91
updates that aren't pkg or version changes
drewp@bigasterisk.com
parents:
69
diff
changeset
|
100 if not is_pi and host.name not in ['prime', 'pipe']: |
12 | 101 apt.packages(packages='plocate') |
102 | |
103 if host.name == "bang": | |
104 apt.packages(packages=[ | |
34
d4fb38f13c79
refactor dns and some other non-net setup
drewp@bigasterisk.com
parents:
25
diff
changeset
|
105 'iptables', |
d4fb38f13c79
refactor dns and some other non-net setup
drewp@bigasterisk.com
parents:
25
diff
changeset
|
106 'openntpd', |
d4fb38f13c79
refactor dns and some other non-net setup
drewp@bigasterisk.com
parents:
25
diff
changeset
|
107 'ntpdate', |
12 | 108 'zfsutils-linux', |
109 'zfs-zed', | |
110 'zfs-auto-snapshot', | |
111 ]) | |
37
fbd0849dfdbd
redo networking to be much simpler. Uses systemd-networkd
drewp@bigasterisk.com
parents:
34
diff
changeset
|
112 |
fbd0849dfdbd
redo networking to be much simpler. Uses systemd-networkd
drewp@bigasterisk.com
parents:
34
diff
changeset
|
113 if host.name == 'plus': |
42 | 114 apt.packages(packages=['network-manager']) |