From d1b52f012ced6890646c1eb96d98d651d4a6816b Mon Sep 17 00:00:00 2001 From: Markos Chandras Date: Wed, 22 Mar 2017 13:41:30 +0000 Subject: [PATCH] Add openSUSE Leap support Add support for the openSUSE Leap distribution Change-Id: I70b4d118f44c2090e48955effab44189866fbb41 --- meta/main.yml | 5 +++++ tasks/haproxy_install.yml | 5 +++++ tasks/haproxy_install_zypper.yml | 26 ++++++++++++++++++++++++++ tasks/haproxy_pre_install.yml | 7 +++++++ vars/main.yml | 16 ++++++++++++++++ vars/suse-42.yml | 21 +++++++++++++++++++++ 6 files changed, 80 insertions(+) create mode 100644 tasks/haproxy_install_zypper.yml create mode 100644 vars/main.yml create mode 100644 vars/suse-42.yml diff --git a/meta/main.yml b/meta/main.yml index 345dd61..f5d39cb 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -26,6 +26,11 @@ galaxy_info: - name: EL versions: - 7 + - name: opensuse + versions: + - 42.1 + - 42.2 + - 42.3 categories: - cloud - python diff --git a/tasks/haproxy_install.yml b/tasks/haproxy_install.yml index 09921d1..6deb7f6 100644 --- a/tasks/haproxy_install.yml +++ b/tasks/haproxy_install.yml @@ -23,6 +23,11 @@ tags: - install-yum +- include: haproxy_install_zypper.yml + when: ansible_pkg_mgr == 'zypper' + tags: + - install-zypper + - include: haproxy_install_hatop.yml - name: Create haproxy conf.d dir diff --git a/tasks/haproxy_install_zypper.yml b/tasks/haproxy_install_zypper.yml new file mode 100644 index 0000000..29f9b48 --- /dev/null +++ b/tasks/haproxy_install_zypper.yml @@ -0,0 +1,26 @@ +--- +# Copyright 2017, SUSE LINUX GmbH. +# +# 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. + +- name: Install zypper packages + zypper: + name: "{{ item }}" + state: "{{ haproxy_package_state }}" + register: install_packages + until: install_packages|success + retries: 5 + delay: 2 + with_items: "{{ haproxy_distro_packages }}" + tags: + - haproxy-zypper-packages diff --git a/tasks/haproxy_pre_install.yml b/tasks/haproxy_pre_install.yml index 41a33e3..eca6d15 100644 --- a/tasks/haproxy_pre_install.yml +++ b/tasks/haproxy_pre_install.yml @@ -67,3 +67,10 @@ tags: - haproxy-dirs - haproxy-logs + +- name: Remove conflicting distro packages + package: + name: "{{ item }}" + state: absent + with_items: + - "{{ haproxy_distro_packages_remove }}" diff --git a/vars/main.yml b/vars/main.yml new file mode 100644 index 0000000..c0e62fe --- /dev/null +++ b/vars/main.yml @@ -0,0 +1,16 @@ +--- +# Copyright 2017, SUSE LINUX GmbH. +# +# 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. + +haproxy_distro_packages_remove: [] diff --git a/vars/suse-42.yml b/vars/suse-42.yml new file mode 100644 index 0000000..ec8f5d6 --- /dev/null +++ b/vars/suse-42.yml @@ -0,0 +1,21 @@ +--- +# Copyright 2017, SUSE LINUX GmbH. +# +# 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. + +haproxy_distro_packages: + - haproxy + - rsyslog # Used for local logging + +haproxy_distro_packages_remove: + - systemd-logger # conflicts with rsyslog