From 0e2d3fb923d83b166f04f3eccd146c976a088af1 Mon Sep 17 00:00:00 2001
From: rongzhang <rongzhang@alauda.io>
Date: Sat, 17 Nov 2018 20:41:07 +0800
Subject: [PATCH] Fix OpenSuse set hostname

---
 roles/bootstrap-os/tasks/main.yml | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/roles/bootstrap-os/tasks/main.yml b/roles/bootstrap-os/tasks/main.yml
index 6a9d47aa1..eb29be41a 100644
--- a/roles/bootstrap-os/tasks/main.yml
+++ b/roles/bootstrap-os/tasks/main.yml
@@ -58,15 +58,14 @@
     name: "{{inventory_hostname}}"
   when:
     - override_system_hostname
-    - ansible_distribution not in ['openSUSE Tumbleweed']
-    - ansible_os_family not in ['CoreOS', 'Container Linux by CoreOS']
+    - ansible_os_family not in ['Suse', 'CoreOS', 'Container Linux by CoreOS']
 
 - name: Assign inventory name to unconfigured hostnames (CoreOS and Tumbleweed only)
   command: "hostnamectl set-hostname  {{inventory_hostname}}"
   register: hostname_changed
   when:
-    - ansible_distribution in ['openSUSE Tumbleweed'] or ansible_os_family in ['CoreOS', 'Container Linux by CoreOS']
     - override_system_hostname
+    - ansible_os_family in ['Suse', 'CoreOS', 'Container Linux by CoreOS']
 
 - name: Update hostname fact (CoreOS and Tumbleweed only)
   setup:
-- 
GitLab