changeset 130:168bc1c44e6f

stop telling arm machines to get i386 pkgs
author drewp@bigasterisk.com
date Wed, 21 Dec 2022 13:09:32 -0800
parents 84701dafa7c3
children 7a94db404be4
files system.py templates/sources.list.j2
diffstat 2 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/system.py	Wed Dec 21 12:48:40 2022 -0800
+++ b/system.py	Wed Dec 21 13:09:32 2022 -0800
@@ -3,6 +3,7 @@
 from pyinfra import host
 from pyinfra.facts.server import LinuxDistribution
 from pyinfra.facts.files import FindFiles
+from pyinfra.facts.server import Arch
 from pyinfra.operations import apt, files, server, systemd
 
 is_pi = host.get_fact(LinuxDistribution)['name'] in ['Debian', 'Raspbian GNU/Linux']
@@ -16,7 +17,8 @@
     files.replace(path='/etc/timezone', text='.*', replace=TZ)
     
 def apt_sources():
-    server.shell(commands=['dpkg --add-architecture i386'])
+    if host.get_fact(Arch) == 'x86_64':
+        server.shell(commands=['dpkg --add-architecture i386'])
 
     files.template(src='templates/sources.list.j2', dest='/etc/apt/sources.list.j2')
     if host.get_fact(FindFiles, '/etc/apt/sources.list.d/', quote_path=True):
--- a/templates/sources.list.j2	Wed Dec 21 12:48:40 2022 -0800
+++ b/templates/sources.list.j2	Wed Dec 21 13:09:32 2022 -0800
@@ -73,6 +73,7 @@
 deb http://ports.ubuntu.com/ubuntu-ports/ jammy-updates main restricted
 deb http://ports.ubuntu.com/ubuntu-ports/ jammy-updates multiverse
 deb http://ports.ubuntu.com/ubuntu-ports/ jammy-updates universe
+deb http://ppa.launchpad.net/hardkernel/ppa/ubuntu jammy main
 {% endif %}
 
 {% if host.name in ['garage'] %}