diff --git a/lib/ansible/module_utils/facts.py b/lib/ansible/module_utils/facts.py index 06b224759ca..424c388fb6e 100644 --- a/lib/ansible/module_utils/facts.py +++ b/lib/ansible/module_utils/facts.py @@ -2383,7 +2383,7 @@ class LinuxVirtual(Virtual): if os.path.exists('/proc/1/cgroup'): for line in get_file_lines('/proc/1/cgroup'): - if re.search('/docker/', line): + if re.search(r'/docker(/|-[0-9a-f]+\.scope)', line): self.facts['virtualization_type'] = 'docker' self.facts['virtualization_role'] = 'guest' return