From ba4f6de35a7499c1e894785d5a9b488002976588 Mon Sep 17 00:00:00 2001 From: Abhijeet Kasurde Date: Fri, 9 Jun 2017 18:17:09 +0530 Subject: [PATCH] Add support for Devuan in hostname module (#25525) Fixes #25395 Signed-off-by: Abhijeet Kasurde --- lib/ansible/module_utils/basic.py | 2 +- lib/ansible/modules/system/hostname.py | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/ansible/module_utils/basic.py b/lib/ansible/module_utils/basic.py index 349b619825c..072f653a5b5 100644 --- a/lib/ansible/module_utils/basic.py +++ b/lib/ansible/module_utils/basic.py @@ -260,7 +260,7 @@ def get_distribution(): ''' return the distribution name ''' if platform.system() == 'Linux': try: - supported_dists = platform._supported_dists + ('arch', 'alpine') + supported_dists = platform._supported_dists + ('arch', 'alpine', 'devuan') distribution = platform.linux_distribution(supported_dists=supported_dists)[0].capitalize() if not distribution and os.path.isfile('/etc/system-release'): distribution = platform.linux_distribution(supported_dists=['system'])[0].capitalize() diff --git a/lib/ansible/modules/system/hostname.py b/lib/ansible/modules/system/hostname.py index 36dba750861..acfb37dd9e8 100644 --- a/lib/ansible/modules/system/hostname.py +++ b/lib/ansible/modules/system/hostname.py @@ -707,6 +707,11 @@ class LinaroHostname(Hostname): distribution = 'Linaro' strategy_class = DebianStrategy +class DevuanHostname(Hostname): + platform = 'Linux' + distribution = 'Devuan' + strategy_class = DebianStrategy + class GentooHostname(Hostname): platform = 'Linux' distribution = 'Gentoo base system'