summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHartmut Goebel <h.goebel@crazy-compilers.com>2015-02-28 14:13:58 +0100
committerToshio Kuratomi <toshio@fedoraproject.org>2015-03-13 11:43:25 -0700
commit41c892baf4666bbdf9195dc75f2ae9dca22f86b6 (patch)
treea08db16195e0d2795c81474b7ea186a075e1ceec
parent7ba49ed43033efb868ebbfeec82c9e2201025600 (diff)
downloadansible-41c892baf4666bbdf9195dc75f2ae9dca22f86b6.tar.gz
Fix detect of docker as virtualization_type.
Not only match`/docker/`, but also `docker-` followed by a hex-id. Example (shortened): ``` $ cat /proc/1/cgroup 8:blkio:/system.slice/docker-de73f4d207861cf8757b69213ee67bb234b897a18bea7385964b6ed2d515da94.scope 7:net_cls:/ ```
-rw-r--r--lib/ansible/module_utils/facts.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/ansible/module_utils/facts.py b/lib/ansible/module_utils/facts.py
index 06b224759c..424c388fb6 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