Hi all,
I have chacked out current ansible Version:
ansible 1.8 (devel cd9ea13716) last updated 2014/10/28 22:08:28 (GMT +200)
lib/ansible/modules/core: (devel 63e81cfc2e) last updated 2014/10/28 22:08:12 (GMT +200)
lib/ansible/modules/extras: (devel 70c7e69b62) last updated 2014/10/28 15:40:03 (GMT +200)
v2/ansible/modules/core: (devel 63e81cfc2e) last updated 2014/10/28 22:08:12 (GMT +200)
v2/ansible/modules/extras: (devel 70c7e69b62) last updated 2014/10/28 15:40:03 (GMT +200)
configured module search path = None
Maybe this is a BUG ?
→ how can it be fixed ?
when I try to execute the comand:
ansible all -m setup -a “filter=ansible_distribution*”
I get the following WRONG result:
localhost | success >> {
“ansible_facts”: {
“ansible_distribution”: “Suse”,
“ansible_distribution_major_version”: “11”,
“ansible_distribution_release”: “x86_64”,
“ansible_distribution_version”: “11”
},
“changed”: false
}
My OS is a Suse Enterprise Linux 11 SP3:
suse01i:~/src> uname -a
Linux suse01i 3.0.101-0.35-default #1 SMP Wed Jul 9 11:43:04 UTC 2014 (c36987d) x86_64 x86_64 x86_64 GNU/Linux
suse01i:~/src> cat /etc/SuSE-release
SUSE Linux Enterprise Server 11 (x86_64)
VERSION = 11
PATCHLEVEL = 3
I found the cause of this issue in:
<ANSIBLE_DIR>lib/ansible/module_utils/facts.py
I have changed the following:
— a/lib/ansible/module_utils/facts.py
+++ b/lib/ansible/module_utils/facts.py
@@ -329,9 +329,10 @@ class Facts(object):
elif path == ‘/etc/SuSE-release’:
data = data.splitlines()
for line in data:
- release = re.search(‘CODENAME *= *([^\n]+)’, line)
+ release = re.search(‘PATCHLEVEL *= *([^\n]+)’, line)
if release:
self.facts[‘distribution_release’] = release.groups()[0].strip()