diff --git a/global/overlay/etc/puppet/setup_cosmos_modules b/global/overlay/etc/puppet/setup_cosmos_modules index 0faaa35..4732c8d 100755 --- a/global/overlay/etc/puppet/setup_cosmos_modules +++ b/global/overlay/etc/puppet/setup_cosmos_modules @@ -4,8 +4,11 @@ import hashlib import os import os.path +import platform import sys +from debian import debian_support + try: from configobj import ConfigObj @@ -109,11 +112,21 @@ def main(): }, } - # Make test machines use special test branch of puppet-sunet: if OS_INFO: - if OS_INFO["ID"] == "ubuntu": - import platform + # Provided by Debian/Ubuntu via + # https://github.com/SUNET/multiverse/blob/main/global/pre-tasks.d/030puppet + if (OS_INFO["ID"] == "debian" and int(OS_INFO["VERSION_ID"]) >= 12) or ( + OS_INFO["ID"] == "ubuntu" + and debian_support.version_compare(OS_INFO["VERSION_ID"], "24.04") >= 0 + ): + del modules["augeas"] + del modules["apt"] + del modules["concat"] + del modules["stdlib"] + + # Make test machines use special test branch of puppet-sunet: + if OS_INFO["ID"] == "ubuntu": nodename = platform.node() name_parts = nodename.split("-") if len(name_parts) > 1: