From dd98ebf88d25aea0b65d36ff4270fbcc99abf51d Mon Sep 17 00:00:00 2001 From: Markos Chandras Date: Wed, 16 Aug 2017 06:13:33 +0100 Subject: [PATCH] Add support for the openSUSE Leap distributions Add support for the openSUSE Leap distributions. Nothing special is required for this except adding the appropriate distro variables file and also update the zypper cache before package installation. We also had to apply the same virtualenv-tools fix similar to CentOS. Change-Id: I8bbf0af1149e4c5ea39f82e4fa7be78578cf6a50 (cherry picked from commit abafaee5c17de3edc8cc551f5a60f15198e9f001) --- meta/main.yml | 8 ++++++++ tasks/sahara_install.yml | 6 +++--- vars/suse-42.yml | 18 ++++++++++++++++++ 3 files changed, 29 insertions(+), 3 deletions(-) create mode 100644 vars/suse-42.yml diff --git a/meta/main.yml b/meta/main.yml index 6d1299a..cb92185 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -9,6 +9,14 @@ galaxy_info: - name: Ubuntu versions: - xenial + - name: EL + versions: + - 7 + - name: opensuse + versions: + - 42.1 + - 42.2 + - 42.3 categories: - cloud - python diff --git a/tasks/sahara_install.yml b/tasks/sahara_install.yml index 9bdc5e5..fe2bc47 100644 --- a/tasks/sahara_install.yml +++ b/tasks/sahara_install.yml @@ -15,7 +15,7 @@ package: name: "{{ item }}" state: "{{ sahara_package_state }}" - update_cache: "{{ (ansible_pkg_mgr == 'apt') | ternary('yes', omit) }}" + update_cache: "{{ (ansible_pkg_mgr in ['apt', 'zypper']) | ternary('yes', omit) }}" cache_valid_time: "{{ (ansible_pkg_mgr == 'apt') | ternary(cache_timeout, omit) }}" register: install_packages until: install_packages|success @@ -102,12 +102,12 @@ notify: - Restart sahara services -- name: CentOS remove python from path first +- name: Remove python from path first (CentOS, openSUSE) file: path: "{{ sahara_bin | dirname }}/bin/python2.7" state: "absent" when: - - ansible_pkg_mgr == 'yum' + - ansible_pkg_mgr in ['yum', 'zypper'] - sahara_get_venv | changed - name: Update virtualenv path diff --git a/vars/suse-42.yml b/vars/suse-42.yml new file mode 100644 index 0000000..7a1ec3f --- /dev/null +++ b/vars/suse-42.yml @@ -0,0 +1,18 @@ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +sahara_distro_packages: + - cronie + - cronie-anacron + - rpcbind + - git-core + - which