Linux Vserver not detected properly #36038
Labels
affects_2.4
This issue/PR affects Ansible v2.4
bug
This issue/PR relates to a bug.
has_pr
This issue has an associated PR.
support:core
This issue/PR relates to code supported by the Ansible Engineering Team.
ISSUE TYPE
COMPONENT NAME
lib/ansible/module_utils/facts/virtual/linux.py
ANSIBLE VERSION
ansible 2.4.3.0
config file = /etc/ansible/ansible.cfg
configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python2.7/dist-packages/ansible
executable location = /usr/bin/ansible
python version = 2.7.6 (default, Nov 23 2017, 15:49:48) [GCC 4.8.4]
Also present in 'devel' branch.
OS / ENVIRONMENT
Host with Linux Vserver:
Linux FQDN 4.1.48-vs2.3.8.6-beng #1 SMP Sun Jan 14 14:33:48 GMT 2018 x86_64 GNU/Linux
SUMMARY
Ansible uses /proc/self/status to detect Linux Vserver with:
ansible/lib/ansible/module_utils/facts/virtual/linux.py
Line 157 in 6a223d5
This doesn't work on my system, the output of /proc/self/status contains:
There are three spaces between 'VxID:' and '40024', the regex only allows one.
Changing the code to:
if re.match(r'^VxID:\s*\d+', line):
Fixes this.
The text was updated successfully, but these errors were encountered: