diff --git a/global/overlay/etc/puppet/setup_cosmos_modules b/global/overlay/etc/puppet/setup_cosmos_modules index fdc2dac..f5e00bc 100755 --- a/global/overlay/etc/puppet/setup_cosmos_modules +++ b/global/overlay/etc/puppet/setup_cosmos_modules @@ -16,6 +16,23 @@ try: except (IOError, ModuleNotFoundError): OS_INFO = None +try: + fqdn = socket.getfqdn() + hostname = fqdn.split('.')[0] +except OSError: + host_info = None +else: + domainname = '.'.join(fqdn.split(".")[1:]) + environ = "beta" if (domainname.find("test") != -1) else "prod" + print(domainname.find("thiss")) + + host_info = { + "domainname": domainname, + "environment": environ, + "fqdn": fqdn, + "hostname": hostname, + } + def get_file_hash(modulesfile): """ @@ -97,6 +114,10 @@ def main(): if name_parts[1] == "test": modules["sunet"]["tag"] = "testing-2*" + if host_info: + if host_info["fqdn"] == "metrics-cd-test-1.sunet.se": + modules["apt"]["tag"] = "pahol-influx*" + # Build list of expected file content file_lines = create_file_content(modules)