Mercurial > code > home > repos > infra
diff system.py @ 130:168bc1c44e6f
stop telling arm machines to get i386 pkgs
author | drewp@bigasterisk.com |
---|---|
date | Wed, 21 Dec 2022 13:09:32 -0800 |
parents | fe3ae7c95e65 |
children | 706d861f6d95 |
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):