From 5a3ee5489b8e8663ef69e486e1366df43897bf0f Mon Sep 17 00:00:00 2001 From: Markos Chandras Date: Tue, 11 Jul 2017 18:25:04 +0100 Subject: [PATCH] Add support for the openSUSE Leap distributions Add support for the openSUSE Leap distributions. Nothing special is required for this except for adding the appropriate distro variables file and also update the zypper cache before package installation. Moreover, the syslog user belongs to the 'users' group instead of a dedicated 'syslog' group so we adjust the defaults for openSUSE. Depends-On: I96c02fb2ee26691f1d7dd449d7205baa231795fe Change-Id: I86beac2b3e038a0a4a3bf9618218bc1e393bdf08 --- defaults/main.yml | 4 +++- meta/main.yml | 7 ++++++- tasks/swift_install.yml | 2 +- vars/suse-42.yml | 32 ++++++++++++++++++++++++++++++++ 4 files changed, 42 insertions(+), 3 deletions(-) create mode 100644 vars/suse-42.yml diff --git a/defaults/main.yml b/defaults/main.yml index 6db40bcd..801d062b 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -61,7 +61,9 @@ swift_system_home_folder: "/var/lib/{{ swift_system_user_name }}" ## Swift Syslog User / Group swift_syslog_user_name: syslog -swift_syslog_group_name: syslog +# NOTE(hwoarang) The syslog user on openSUSE belongs to the 'users' +# group. There is no dedicated syslog group. +swift_syslog_group_name: "{{ (ansible_pkg_mgr == 'zypper') | ternary ('users', 'syslog') }}" swift_syslog_log_perms: "0644" ## Auth token diff --git a/meta/main.yml b/meta/main.yml index 1868b364..4fcaa074 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -23,9 +23,14 @@ galaxy_info: - name: Ubuntu versions: - xenial - - name: CentOS + - name: EL versions: - 7 + - name: opensuse + versions: + - 42.1 + - 42.2 + - 42.3 categories: - cloud - python diff --git a/tasks/swift_install.yml b/tasks/swift_install.yml index 40f84793..8f962620 100644 --- a/tasks/swift_install.yml +++ b/tasks/swift_install.yml @@ -17,7 +17,7 @@ package: name: "{{ item }}" state: "{{ swift_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 diff --git a/vars/suse-42.yml b/vars/suse-42.yml new file mode 100644 index 00000000..201fa9ce --- /dev/null +++ b/vars/suse-42.yml @@ -0,0 +1,32 @@ +--- +# Copyright 2016, Rackspace US, Inc. +# 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. + +swift_distro_packages: + - curl + - gcc + - git-core + - liberasurecode1 + - liberasurecode-devel + - libffi-devel + - openssh + - python-devel + - rsync + - libopenssl-devel + - cronie + - cronie-anacron + - which + +swift_rsync_service_name: rsyncd