Remove references to unsupported operating systems

All references to Gentoo, SUSE, Debian stretch and Centos-7  are removed.
Conditional tasks, ternary operators and variables are simplified where possible
OS specific variables files are generalised where possible

Change-Id: I8ccd8ef5cbb4a29b782418ffa33e635962f0941e
This commit is contained in:
Jonathan Rosser 2021-03-16 09:18:32 +00:00 committed by Erik Berg
parent 767c00a577
commit e4d8d7836e
6 changed files with 100 additions and 132 deletions

View File

@ -22,17 +22,15 @@ galaxy_info:
platforms:
- name: Debian
versions:
- stretch
- buster
- name: Ubuntu
versions:
- xenial
- bionic
- focal
- name: EL
versions:
- 7
- name: opensuse
versions:
- all
- 8
categories:
- cloud
- ceph

View File

@ -17,7 +17,7 @@
package:
name: '{{ ceph_client_filtered_packages }}'
state: "{{ ceph_client_package_state }}"
update_cache: "{{ (ansible_facts['pkg_mgr'] in ['apt', 'zypper']) | ternary('yes', omit) }}"
update_cache: "{{ (ansible_facts['pkg_mgr'] == 'apt') | ternary('yes', omit) }}"
cache_valid_time: "{{ (ansible_facts['pkg_mgr'] == 'apt') | ternary(cache_timeout, omit) }}"
register: install_packages
until: install_packages is success

View File

@ -1 +0,0 @@
ceph_preinstall_yum.yml

View File

@ -0,0 +1,94 @@
---
# Copyright 2017 Marc Gariépy <gariepy.marc@gmail.com>
#
# 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: Copy EPEL gpg keyfile to the key location
copy:
src: "gpg/{{ item.key | basename }}"
dest: "{{ item.key }}"
mode: '0644'
with_items: "{{ epel_gpg_keys }}"
when:
- ansible_facts['pkg_mgr'] == 'dnf'
- name: Install EPEL gpg keys
rpm_key: "{{ key }}"
with_items: "{{ epel_gpg_keys }}"
loop_control:
loop_var: key
when:
- ansible_facts['pkg_mgr'] == 'dnf'
register: _add_epel_keys
until: _add_epel_keys is success
retries: 5
delay: 2
- name: Install the EPEL repository
yum_repository:
name: ceph-client-deps
baseurl: "{{ (centos_epel_mirror | default ('http://download.fedoraproject.org/pub/epel')) ~ '/' ~ ansible_facts['distribution_major_version'] ~ '/Everything/' ~ ansible_facts['architecture'] }}"
description: "Extra Packages for Enterprise Linux {{ ansible_facts['distribution_major_version'] }} - $basearch"
gpgcheck: yes
enabled: yes
state: present
includepkgs: 'lttng-ust*, userspace-rcu, libbabeltrace, leveldb, liboath'
when:
- ansible_facts['pkg_mgr'] == 'dnf'
register: install_epel_repo
until: install_epel_repo is success
retries: 5
delay: 2
- name: Copy Ceph gpg keyfile to the key location
copy:
src: "gpg/{{ item.key | basename }}"
dest: "{{ item.key }}"
mode: '0644'
with_items: "{{ ceph_gpg_keys }}"
when:
- ceph_pkg_source == 'ceph'
- name: Install Ceph gpg keys
rpm_key: "{{ key }}"
with_items: "{{ ceph_gpg_keys }}"
loop_control:
loop_var: key
when:
- ceph_pkg_source == 'ceph'
register: _add_ceph_keys
until: _add_ceph_keys is success
retries: 5
delay: 2
- name: Add ceph repo
yum_repository:
name: ceph
description: "Ceph packages for $basearch"
file: ceph
baseurl: "{{ ceph_yum_repo_url }}/$basearch"
gpgcheck: yes
enabled: yes
priority: 50
state: present
- name: Add ceph noarch repo
yum_repository:
name: ceph-noarch
description: "Ceph noarch packages"
file: ceph
baseurl: "{{ ceph_yum_repo_url }}/noarch"
gpgcheck: yes
enabled: yes
priority: 50
state: present

View File

@ -1,94 +0,0 @@
---
# Copyright 2017 Marc Gariépy <gariepy.marc@gmail.com>
#
# 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: Copy EPEL gpg keyfile to the key location
copy:
src: "gpg/{{ item.key | basename }}"
dest: "{{ item.key }}"
mode: '0644'
with_items: "{{ epel_gpg_keys }}"
when:
- ansible_facts['pkg_mgr'] in ['yum','dnf']
- name: Install EPEL gpg keys
rpm_key: "{{ key }}"
with_items: "{{ epel_gpg_keys }}"
loop_control:
loop_var: key
when:
- ansible_facts['pkg_mgr'] in ['yum','dnf']
register: _add_epel_keys
until: _add_epel_keys is success
retries: 5
delay: 2
- name: Install the EPEL repository
yum_repository:
name: ceph-client-deps
baseurl: "{{ (centos_epel_mirror | default ('http://download.fedoraproject.org/pub/epel')) ~ '/' ~ ansible_facts['distribution_major_version'] ~ ((ansible_facts['distribution_major_version'] is version('8', '<')) | ternary('/', '/Everything/')) ~ ansible_facts['architecture'] }}"
description: "Extra Packages for Enterprise Linux {{ ansible_facts['distribution_major_version'] }} - $basearch"
gpgcheck: yes
enabled: yes
state: present
includepkgs: 'lttng-ust*, userspace-rcu, libbabeltrace, leveldb, liboath'
when:
- ansible_facts['pkg_mgr'] in ['yum', 'dnf']
register: install_epel_repo
until: install_epel_repo is success
retries: 5
delay: 2
- name: Copy Ceph gpg keyfile to the key location
copy:
src: "gpg/{{ item.key | basename }}"
dest: "{{ item.key }}"
mode: '0644'
with_items: "{{ ceph_gpg_keys }}"
when:
- ceph_pkg_source == 'ceph'
- name: Install Ceph gpg keys
rpm_key: "{{ key }}"
with_items: "{{ ceph_gpg_keys }}"
loop_control:
loop_var: key
when:
- ceph_pkg_source == 'ceph'
register: _add_ceph_keys
until: _add_ceph_keys is success
retries: 5
delay: 2
- name: Add ceph repo
yum_repository:
name: ceph
description: "Ceph packages for $basearch"
file: ceph
baseurl: "{{ ceph_yum_repo_url }}/$basearch"
gpgcheck: yes
enabled: yes
priority: 50
state: present
- name: Add ceph noarch repo
yum_repository:
name: ceph-noarch
description: "Ceph noarch packages"
file: ceph
baseurl: "{{ ceph_yum_repo_url }}/noarch"
gpgcheck: yes
enabled: yes
priority: 50
state: present

View File

@ -23,7 +23,7 @@
- name: Gather variables for each operating system
include_vars: "{{ item }}"
with_first_found:
- "{{ ansible_facts['distribution'] | lower }}-{{ ansible_dfacts['istribution_version'] | lower }}.yml"
- "{{ ansible_facts['distribution'] | lower }}-{{ ansible_facts['distribution_version'] | lower }}.yml"
- "{{ ansible_facts['distribution'] | lower }}-{{ ansible_facts['distribution_major_version'] | lower }}.yml"
- "{{ ansible_facts['os_family'] | lower }}-{{ ansible_facts['distribution_major_version'] | lower }}.yml"
- "{{ ansible_facts['distribution'] | lower }}.yml"

View File

@ -1,29 +0,0 @@
---
# 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.
libvirt_packages:
- qemu-kvm
libvirt_service_name: libvirtd
python_ceph_packages:
- "{{ (ansible_facts['distribution_version'] is version ('42', '>=')) | ternary('python-cephfs', 'python3-cephfs') }}"
- "{{ (ansible_facts['distribution_version'] is version ('42', '>=')) | ternary('python-rados', 'python3-rados') }}"
- "{{ (ansible_facts['distribution_version'] is version ('42', '>=')) | ternary('python-rbd', 'python3-rbd') }}"
- "{{ (ansible_facts['distribution_version'] is version ('42', '>=')) | ternary('python-rgw', 'python3-rgw') }}"
# NOTE(hwoarang) Upstream does not provide openSUSE packages
# so we always set ceph_pkg_source to 'distro' for openSUSE
ceph_pkg_source: 'distro'