From: David Galloway Date: Mon, 13 Jan 2020 23:35:09 +0000 (-0500) Subject: ansible: Set hostname on OpenSUSE X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F1481%2Fhead;p=ceph-build.git 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 --- 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