comparison packages.py @ 114:7e280bf26dba

package lists big update, pulling from /var/log/apt on a few hosts
author drewp@bigasterisk.com
date Sat, 29 Oct 2022 21:34:50 -0700
parents 0381ed592b5c
children fe3ae7c95e65
comparison
equal deleted inserted replaced
113:c520672d0930 114:7e280bf26dba
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, server 3 from pyinfra.operations import apt, files, server
4 import package_lists
4 5
5 is_pi = host.get_fact(LinuxDistribution)['name'] in ['Debian', 'Raspbian GNU/Linux'] 6 is_pi = host.get_fact(LinuxDistribution)['name'] in ['Debian', 'Raspbian GNU/Linux']
6 7
7 8
8 def kitty(): 9 def kitty():
9 vers = '0.25.2' # see https://github.com/kovidgoyal/kitty/releases 10 vers = '0.26.4' # see https://github.com/kovidgoyal/kitty/releases
10 home = '/home/drewp' 11 home = '/home/drewp'
11 local = f"{home}/.local/kitty" 12 local = f"{home}/.local/kitty"
12 dl = f'/tmp/kitty-{vers}-x86_64.txz' 13 dl = f'/tmp/kitty-{vers}-x86_64.txz'
13 files.download(src=f"https://github.com/kovidgoyal/kitty/releases/download/v{vers}/kitty-{vers}-x86_64.txz", dest=dl) 14 files.download(src=f"https://github.com/kovidgoyal/kitty/releases/download/v{vers}/kitty-{vers}-x86_64.txz", dest=dl)
14 files.directory(local) 15 files.directory(local)
21 22
22 def pnpm(): 23 def pnpm():
23 server.shell([ 24 server.shell([
24 # https://github.com/pnpm/pnpm/releases 25 # https://github.com/pnpm/pnpm/releases
25 # but also https://pnpm.io/installation#compatibility 26 # but also https://pnpm.io/installation#compatibility
26 "npm install -g pnpm@6.32.22", 27 "npm install -g pnpm@6.35.0",
27 ]) 28 ])
28 29
29 30
30 def proper_locate(): 31 def proper_locate():
31 apt.packages(packages='mlocate', present=False) 32 apt.packages(packages='mlocate', present=False)
37 apt.packages(packages=['mandb', 'apt-listchanges'], present=False) 38 apt.packages(packages=['mandb', 'apt-listchanges'], present=False)
38 files.template(src='templates/pi_sources.list.j2', dest='/etc/apt/sources.list', rel='bullseye') 39 files.template(src='templates/pi_sources.list.j2', dest='/etc/apt/sources.list', rel='bullseye')
39 # 'apt upgrade'? 40 # 'apt upgrade'?
40 apt.packages( 41 apt.packages(
41 update=False, # see system.py 42 update=False, # see system.py
42 packages=['dirmngr', 'gnupg2', 'apt-utils', 'aptitude']) 43 packages=package_lists.pi_setup)
43 44
44 apt.key(src='https://ftp-master.debian.org/keys/archive-key-8.asc') 45 apt.key(src='https://ftp-master.debian.org/keys/archive-key-8.asc')
45 apt.key(src='https://ftp-master.debian.org/keys/archive-key-8-security.asc') 46 apt.key(src='https://ftp-master.debian.org/keys/archive-key-8-security.asc')
46 apt.key(src='https://ftp-master.debian.org/keys/archive-key-9-security.asc') 47 apt.key(src='https://ftp-master.debian.org/keys/archive-key-9-security.asc')
47 apt.key(keyserver='keyserver.ubuntu.com', keyid='04EE7237B7D453EC') 48 apt.key(keyserver='keyserver.ubuntu.com', keyid='04EE7237B7D453EC')
53 54
54 55
55 if not is_pi: 56 if not is_pi:
56 apt.key(keyserver='keyserver.ubuntu.com', keyid='8B48AD6246925553') 57 apt.key(keyserver='keyserver.ubuntu.com', keyid='8B48AD6246925553')
57 58
59
60 if host.name in ['pipe','prime'] or is_pi:
61 apt.packages(packages=['mandb'], present=False)
62
58 if host.name == 'pipe': 63 if host.name == 'pipe':
59 apt.packages(packages=['mandb', 'apt-listchanges'], present=False) 64 apt.packages(packages=['apt-listchanges'], present=False)
60 files.template(src='templates/odroid_sources.list.j2', dest='/etc/apt/sources.list', rel='focal') 65 files.template(src='templates/odroid_sources.list.j2', dest='/etc/apt/sources.list', rel='focal')
61 apt.packages(packages=[
62 'python3-iptables',
63 'podman-docker',
64 ])
65 elif is_pi: 66 elif is_pi:
66 pi_sources() 67 pi_sources()
67 68
68 apt.packages(packages=[ 69 apt.packages(packages=package_lists.setup)
69 'build-essential',
70 'dstat',
71 'ifstat',
72 'iptables',
73 'iproute2', # needed for wireguard
74 'kitty-terminfo',
75 'mosquitto-clients',
76 'ncdu',
77 'rsync',
78 'xosview',
79 'zsh',
80 "atool",
81 "udns-utils",
82 "wireguard-tools",
83 ])
84
85 if not is_pi: 70 if not is_pi:
86 if host.name != 'prime': 71 if host.name != 'prime':
87 apt.key(src='https://dl.google.com/linux/linux_signing_key.pub') 72 apt.key(src='https://dl.google.com/linux/linux_signing_key.pub')
88 apt.repo(src='deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main') 73 apt.repo(src='deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main')
89 74
91 apt.repo(src="deb [arch=amd64,arm64,armhf] http://packages.microsoft.com/repos/code stable main") 76 apt.repo(src="deb [arch=amd64,arm64,armhf] http://packages.microsoft.com/repos/code stable main")
92 77
93 apt.key(keyserver='keyserver.ubuntu.com', keyid='F24AEA9FB05498B7') 78 apt.key(keyserver='keyserver.ubuntu.com', keyid='F24AEA9FB05498B7')
94 apt.repo(src="deb [arch=amd64,i386] https://repo.steampowered.com/steam/ stable steam") 79 apt.repo(src="deb [arch=amd64,i386] https://repo.steampowered.com/steam/ stable steam")
95 80
96 apt.packages(packages=[ 81 apt.packages(packages=package_lists.non_pi)
97 'debian-goodies',
98 'ethtool',
99 'htop',
100 'iotop',
101 'keychain',
102 'lpr',
103 'lua5.3',
104 'mercurial',
105 'mtr-tiny',
106 'net-tools',
107 'nodejs',
108 'npm',
109 'oping',
110 'python3-invoke',
111 'python3-pip',
112 'python3-virtualenv',
113 'speedtest-cli',
114 'sysstat',
115 'tcpdump',
116 ])
117 if host.name in ['dash', 'slash', 'bang']:
118 apt.packages(packages=[
119 'podman-docker',
120 ])
121 if host.name != 'pipe': 82 if host.name != 'pipe':
122 apt.packages(packages=[ 83 apt.packages(packages=[
123 'reptyr', 84 'reptyr',
124 ]) 85 ])
125 86
126 kitty() 87 kitty()
127 pnpm() 88 pnpm()
128 89
90 proper_locate()
91 apt.packages(packages=package_lists.general)
92 apt.packages(packages=package_lists.debug)
129 93
130 proper_locate()
131 94
132 if host.name == "bang": 95 if host.name == "bang":
133 apt.packages(packages=[ 96 apt.packages(packages=package_lists.for_bang)
134 'dnsmasq', 97
135 'iptables', 98 if host.name == "pipe":
136 'ntpdate', 99 apt.packages(packages=package_lists.for_pipe)
137 'openntpd',
138 'zfs-auto-snapshot',
139 'zfs-zed',
140 'zfsutils-linux',
141 ])
142 100
143 if host.name == 'plus': 101 if host.name == 'plus':
144 apt.packages(packages=[ 102 apt.packages(packages=package_lists.laptop)
145 'network-manager', 103
146 'brightnessctl', 104 desktop_env = host.name in ['dash', 'slash', 'plus']
147 'xserver-xorg-input-synaptics', 105 if desktop_env:
148 ]) 106 apt.packages(packages=package_lists.xorg + package_lists.desktop)