From 39b16f294c8edf513e31bded7a850dde66301dee Mon Sep 17 00:00:00 2001 From: Derek Olsen Date: Thu, 31 Mar 2016 14:39:55 -0700 Subject: [PATCH] Only set distribution_release on CoreOS nodes that autoupdate. Fixes #15228 --- lib/ansible/module_utils/facts.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/ansible/module_utils/facts.py b/lib/ansible/module_utils/facts.py index 796ebc92bdd..a9030c2dd44 100644 --- a/lib/ansible/module_utils/facts.py +++ b/lib/ansible/module_utils/facts.py @@ -493,9 +493,10 @@ class Facts(object): if self.facts['distribution'].lower() == 'coreos': data = get_file_content('/etc/coreos/update.conf') - release = re.search("^GROUP=(.*)", data) - if release: - self.facts['distribution_release'] = release.group(1).strip('"') + if data: + release = re.search("^GROUP=(.*)", data) + if release: + self.facts['distribution_release'] = release.group(1).strip('"') else: self.facts['distribution'] = name machine_id = get_file_content("/var/lib/dbus/machine-id") or get_file_content("/etc/machine-id")