From 25e00a7bbd61913e6991d773c86075933d5c55d4 Mon Sep 17 00:00:00 2001 From: David Galloway Date: Mon, 13 Jan 2020 18:35:09 -0500 Subject: [PATCH] ansible: Set hostname on OpenSUSE Now that we're using system-provided ansible packages (https://github.com/ceph/mita/pull/135), we're at the mercy of the version provided. OpenSUSE Leap 15.1 gives us ansible 2.8.1 which has this bug: https://github.com/ansible/ansible/issues/42726 Signed-off-by: David Galloway --- ansible/examples/slave.yml | 6 ++++++ ansible/examples/slave_static.yml | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/ansible/examples/slave.yml b/ansible/examples/slave.yml index cf9b0ab7..062a6ac9 100644 --- a/ansible/examples/slave.yml +++ b/ansible/examples/slave.yml @@ -409,6 +409,12 @@ - name: Set Hostname with hostname command hostname: name: "ceph-builders" + when: ansible_os_family != "Suse" + + # https://github.com/ansible/ansible/issues/42726 + - name: Set Hostname on OpenSUSE Leap + command: 'hostname ceph-builders' + when: ansible_os_family == "Suse" - name: ensure that 127.0.1.1 is present with an actual hostname lineinfile: diff --git a/ansible/examples/slave_static.yml b/ansible/examples/slave_static.yml index b548f987..36d286a9 100644 --- a/ansible/examples/slave_static.yml +++ b/ansible/examples/slave_static.yml @@ -299,6 +299,12 @@ become: yes hostname: name: "{{ ansible_hostname }}" + when: ansible_os_family != "Suse" + + # https://github.com/ansible/ansible/issues/42726 + - name: Set Hostname on OpenSUSE Leap + command: 'hostname ceph-builders' + when: ansible_os_family == "Suse" - name: ensure that the current host is in /etc/hosts. Yes this is a thing. become: true -- 2.39.5