From 36ce019bebe37b01c09cbded7540389c319488de Mon Sep 17 00:00:00 2001 From: Vladislav Lewin Date: Fri, 22 May 2015 13:26:25 +0200 Subject: [PATCH] add SLE12 support to hostname.py --- lib/ansible/modules/system/hostname.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/ansible/modules/system/hostname.py b/lib/ansible/modules/system/hostname.py index 1fe16e506f4..b90b0441595 100644 --- a/lib/ansible/modules/system/hostname.py +++ b/lib/ansible/modules/system/hostname.py @@ -368,6 +368,15 @@ class FedoraHostname(Hostname): distribution = 'Fedora' strategy_class = SystemdStrategy +class SLESHostname(Hostname): + platform = 'Linux' + distribution = 'Suse linux enterprise server ' + distribution_version = get_distribution_version() + if distribution_version and LooseVersion(distribution_version) >= LooseVersion("12"): + strategy_class = SystemdStrategy + else: + strategy_class = UnimplementedStrategy + class OpenSUSEHostname(Hostname): platform = 'Linux' distribution = 'Opensuse '