diff apt.py @ 282:e10ee3ddadcf

pi changes
author drewp@bigasterisk.com
date Mon, 15 Apr 2024 02:27:07 -0700
parents 5c5c314051c5
children 0befc8696a07
line wrap: on
line diff
--- a/apt.py	Mon Apr 15 00:04:41 2024 -0700
+++ b/apt.py	Mon Apr 15 02:27:07 2024 -0700
@@ -1,3 +1,4 @@
+import io
 from pathlib import Path
 import shlex
 from pyinfra import host
@@ -9,6 +10,7 @@
 
 is_pi = host.get_fact(LinuxDistribution)['name'] in ['Debian', 'Raspbian GNU/Linux']
 
+
 def pkg_keys():
     files.directory(path='/etc/apt/keyrings/')  # for raspi
     for url, name in [
@@ -43,7 +45,7 @@
     # also these
     #-rw-r--r-- 1 root root 2794 Mar 26  2021 /etc/apt/trusted.gpg.d/ubuntu-keyring-2012-cdimage.gpg
     #-rw-r--r-- 1 root root 1733 Mar 26  2021 /etc/apt/trusted.gpg.d/ubuntu-keyring-2018-archive.gpg
-        
+
     # raspi needs wget http://archive.raspbian.org/raspbian.public.key -O - | sudo apt-key add -
 
 
@@ -88,6 +90,13 @@
 def flatpak_sources():
     server.shell('flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo')
 
+
+def correct_dns():
+    files.put(src=io.StringIO("nameserver 10.2.0.3\n"), dest='/etc/resolv.conf')
+
+
+if is_pi:
+    correct_dns()
 pkg_keys()
 apt_sources()
-flatpak_sources()
\ No newline at end of file
+flatpak_sources()