From add3cfb7e4eddfc99f6dd77583304cef87b78be1 Mon Sep 17 00:00:00 2001 From: stephane Date: Thu, 15 Sep 2016 12:56:07 -0700 Subject: [PATCH] Workaround openSUSE ansible_os_family issue https://github.com/ansible/ansible/issues/17573 was filed regarding incorrect detection of ansible_os_family for openSUSE distributions. https://github.com/ansible/ansible/pull/17575 has been submitted, but in the interim we need to work around this issue. Change-Id: Ic88dd7c76df761ffc39369ddbd1d75284390b74e --- .../roles/bifrost-create-vm-nodes/tasks/main.yml | 14 ++++++++++++++ .../roles/bifrost-ironic-install/tasks/main.yml | 14 ++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/playbooks/roles/bifrost-create-vm-nodes/tasks/main.yml b/playbooks/roles/bifrost-create-vm-nodes/tasks/main.yml index ba68f1197..0c9878410 100644 --- a/playbooks/roles/bifrost-create-vm-nodes/tasks/main.yml +++ b/playbooks/roles/bifrost-create-vm-nodes/tasks/main.yml @@ -14,6 +14,20 @@ # # TODO: Consider converting to ansible virt module. --- +# NOTE(cinerama) openSUSE Tumbleweed & Leap have different distribution +# IDs which are not currently accounted for in Ansible, so adjust facts +# so we can have shared defaults for the whole SuSE family. +# This change can be removed when the pull request at +# https://github.com/ansible/ansible/pull/17575 lands in a new version. +- name: Ensure openSUSE Tumbleweed has the correct family + set_fact: + ansible_os_family: "Suse" + when: ansible_os_family | search("openSUSE Tumbleweed") +- name: Ensure openSUSE Leap has the correct family + set_fact: + ansible_os_family: "Suse" + when: (ansible_os_family | search("SUSE LINUX")) or + (ansible_os_family | search("openSUSE Leap")) - name: "Update apt cache if Ubuntu/Debian" apt: update_cache: yes diff --git a/playbooks/roles/bifrost-ironic-install/tasks/main.yml b/playbooks/roles/bifrost-ironic-install/tasks/main.yml index 1eeb363e4..fecc231d4 100644 --- a/playbooks/roles/bifrost-ironic-install/tasks/main.yml +++ b/playbooks/roles/bifrost-ironic-install/tasks/main.yml @@ -13,6 +13,20 @@ # See the License for the specific language governing permissions and # limitations under the License. --- +# NOTE(cinerama) openSUSE Tumbleweed & Leap have different distribution +# IDs which are not currently accounted for in Ansible, so adjust facts +# so we can have shared defaults for the whole SuSE family. +# This change can be removed when the pull request at +# https://github.com/ansible/ansible/pull/17575 lands in a new version. +- name: Ensure openSUSE Tumbleweed has the correct family + set_fact: + ansible_os_family: "Suse" + when: ansible_os_family | search("openSUSE Tumbleweed") +- name: Ensure openSUSE Leap has the correct family + set_fact: + ansible_os_family: "Suse" + when: (ansible_os_family | search("SUSE LINUX")) or + (ansible_os_family | search("openSUSE Leap")) # NOTE(cinerama) dummy-defaults.yml is an empty defaults file. We use it # here to ensure that with_first_found won't fail should we not have # defaults for a particular distribution, version, etc.