Merge pull request #3731 from riverzhang/suse

Fix OpenSuse set hostname
pull/3733/head
Rong Zhang 2018-11-17 21:33:58 +08:00 committed by GitHub
commit 3c6ee19785
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 3 deletions

View File

@ -58,15 +58,14 @@
name: "{{inventory_hostname}}" name: "{{inventory_hostname}}"
when: when:
- override_system_hostname - override_system_hostname
- ansible_distribution not in ['openSUSE Tumbleweed'] - ansible_os_family not in ['Suse', 'CoreOS', 'Container Linux by CoreOS']
- ansible_os_family not in ['CoreOS', 'Container Linux by CoreOS']
- name: Assign inventory name to unconfigured hostnames (CoreOS and Tumbleweed only) - name: Assign inventory name to unconfigured hostnames (CoreOS and Tumbleweed only)
command: "hostnamectl set-hostname {{inventory_hostname}}" command: "hostnamectl set-hostname {{inventory_hostname}}"
register: hostname_changed register: hostname_changed
when: when:
- ansible_distribution in ['openSUSE Tumbleweed'] or ansible_os_family in ['CoreOS', 'Container Linux by CoreOS']
- override_system_hostname - override_system_hostname
- ansible_os_family in ['Suse', 'CoreOS', 'Container Linux by CoreOS']
- name: Update hostname fact (CoreOS and Tumbleweed only) - name: Update hostname fact (CoreOS and Tumbleweed only)
setup: setup: