Support querying systemd container information
diff --git a/lib/ansible/module_utils/facts.py b/lib/ansible/module_utils/facts.py
index 628d1dd267833c..300ed3ad2ea966 100644
--- a/lib/ansible/module_utils/facts.py
+++ b/lib/ansible/module_utils/facts.py
@@ -2394,6 +2394,12 @@ def get_virtual_facts(self):
                 self.facts['virtualization_role'] = 'guest'
             return
 
+        systemd_container = get_file_content('/run/systemd/container')
+        if systemd_container:
+            self.facts['virtualization_type'] = systemd_container
+            self.facts['virtualization_role'] = 'guest'
+            return
+
         if os.path.exists('/proc/1/cgroup'):
             for line in get_file_lines('/proc/1/cgroup'):
                 if re.search(r'/docker(/|-[0-9a-f]+\.scope)', line):

systemd writes a /run/systemd/container file in any container it starts to make it really easy to detect the container type.

This adds support for detecting systemd-nspawn containers (and any other container format that will write data there for compatibility). Otherwise we have to look for  `1:name=systemd:/system.slice/` in `/proc/1/cgroup`, which I'm not confident will be unique enough.
