Test new class

This commit is contained in:
Johan Wassberg 2025-04-23 11:42:12 +02:00
parent d73922ce2c
commit 8234dba15d
Signed by: jocar
GPG key ID: BE4EC2EEADF2C31B

View file

@ -5,6 +5,7 @@ import hashlib
import os
import os.path
import sys
import socket
try:
from configobj import ConfigObj
@ -13,6 +14,24 @@ try:
except (IOError, ModuleNotFoundError):
OS_INFO = None
try:
fqdn = socket.getfqdn()
hostname = socket.gethostname()
except OSError:
host_info = None
else:
domainname = fqdn[len(hostname + ".") :]
environ = "test" if (domainname.find("test") != -1) else "prod"
customer = domainname.split(".")[0]
host_info = {
"customer": customer,
"domainname": domainname,
"environment": environ,
"fqdn": fqdn,
"hostname": hostname,
}
def get_file_hash(modulesfile):
"""
@ -94,6 +113,14 @@ def main():
if OS_INFO["VERSION_CODENAME"] == "bullseye":
pass
if host_info:
if "edu-dco-test-srv-1.komreg.net" in host_info["fqdn"]:
modules["eidas"] = {
"repo": "https://platform.sunet.se/swedenconnect/puppet-eid.git",
"upgrade": "yes",
"tag": "jocar-openidfeds-2*",
}
# Build list of expected file content
file_lines = create_file_content(modules)