comparison apt.py @ 309:f17d9925a2aa

ubuntu update changed sources a bit
author drewp@bigasterisk.com
date Mon, 16 Sep 2024 20:10:00 -0700
parents d000aead76d4
children
comparison
equal deleted inserted replaced
308:5449b2aea2df 309:f17d9925a2aa
58 dir / 'google-chrome-unstable.list', 58 dir / 'google-chrome-unstable.list',
59 dir / 'steam-stable.list', 59 dir / 'steam-stable.list',
60 dir / 'raspi.list', 60 dir / 'raspi.list',
61 ]): 61 ]):
62 found = map(Path, cast(str, host.get_fact(FindFiles, dir, quote_path=True))) 62 found = map(Path, cast(str, host.get_fact(FindFiles, dir, quote_path=True)))
63 if set(found) - set(known): 63 if set(found) - set(known) - {dir / 'ubuntu.sources'}:
64 raise SystemExit(f"new files in {host.name} /etc/apt/sources.list.d/ - please remove") 64 raise SystemExit(f"new files in {host.name} /etc/apt/sources.list.d/ - please remove")
65 for f in known: 65 for f in known:
66 files.file(path=f, present=False) 66 files.file(path=f, present=False)
67 67
68 68
69 def apt_sources(): 69 def apt_sources():
70 if host.get_fact(Arch) == 'x86_64': 70 if host.get_fact(Arch) == 'x86_64':
71 server.shell(commands=['dpkg --add-architecture i386']) 71 server.shell(commands=['dpkg --add-architecture i386'])
72 72
73 files.template(src='templates/sources.list.j2', dest='/etc/apt/sources.list') 73 files.template(src='templates/sources.list.j2', dest='/etc/apt/sources.list')
74
75 if 'big' in host.groups or 'laptop' in host.groups or 'hosted' in host.groups:
76 files.template(src='templates/ubuntu.sources.j2', dest='/etc/apt/sources.list.d/ubuntu.sources')
74 77
75 clear_known_sources_files() 78 clear_known_sources_files()
76 apt.packages(update=True, 79 apt.packages(update=True,
77 cache_time=86400, 80 cache_time=86400,
78 packages=['tzdata'], 81 packages=['tzdata'],