diff --git a/src/ansible_compat/runtime.py b/src/ansible_compat/runtime.py index 31f95666..a7b9acab 100644 --- a/src/ansible_compat/runtime.py +++ b/src/ansible_compat/runtime.py @@ -922,7 +922,8 @@ def _update_env(self, varname: str, value: list[str], default: str = "") -> None return orig_value = self.environ.get(varname, default) if orig_value: - value = [*value, *orig_value.split(":")] + # we just want to avoid repeating the same entries, but order is important + value = list(dict.fromkeys([*value, *orig_value.split(":")])) value_str = ":".join(value) if value_str != self.environ.get(varname, ""): self.environ[varname] = value_str