Readd CentOS 7 with conditions

The CentOS 7 distribution could still be used be deploying ceph if
  - it's a containerized deployment
  - it's a non containerized deployment without the dashboard (due to
missing python3 libraries).

The ceph_stable_redhat_distro variable has been remove because we can
rely on the ansible_distribution_major_version fact instead.

The copr el8 repository configuration is only applied for CentOS 8.

The ceph-mgr-dashboard package is only installed when the
dashboard_enabled variable is set to true.

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
pull/5307/head
Dimitri Savineau 2020-04-02 15:58:11 -04:00 committed by Guillaume Abrioux
parent 86959abf9b
commit 2547ab601a
13 changed files with 49 additions and 51 deletions

View File

@ -86,7 +86,7 @@ dummy:
#centos_package_dependencies: #centos_package_dependencies:
# - epel-release # - epel-release
# - python3-libselinux # - "{{ 'python3-libselinux' if ansible_distribution_major_version | int >= 8 else 'libselinux-python' }}"
#redhat_package_dependencies: [] #redhat_package_dependencies: []
@ -158,10 +158,6 @@ dummy:
# for more info read: https://github.com/ceph/ceph-ansible/issues/305 # for more info read: https://github.com/ceph/ceph-ansible/issues/305
#ceph_stable_distro_source: "{{ ansible_distribution_release }}" #ceph_stable_distro_source: "{{ ansible_distribution_release }}"
# This option is needed for _both_ stable and dev version, so please always fill the right version
# # for supported distros, see http://download.ceph.com/rpm-{{ ceph_stable_release }}/
#ceph_stable_redhat_distro: el8
# REPOSITORY: RHCS VERSION RED HAT STORAGE (from 5.0) # REPOSITORY: RHCS VERSION RED HAT STORAGE (from 5.0)
# #

View File

@ -31,8 +31,6 @@ dummy:
# Ceph mgr packages to install, ceph-mgr + extra module packages. # Ceph mgr packages to install, ceph-mgr + extra module packages.
#ceph_mgr_packages: #ceph_mgr_packages:
# - ceph-mgr # - ceph-mgr
# - ceph-mgr-dashboard
# - ceph-mgr-diskprediction-local
########## ##########

View File

@ -86,7 +86,7 @@ fetch_directory: ~/ceph-ansible-keys
#centos_package_dependencies: #centos_package_dependencies:
# - epel-release # - epel-release
# - python3-libselinux # - "{{ 'python3-libselinux' if ansible_distribution_major_version | int >= 8 else 'libselinux-python' }}"
#redhat_package_dependencies: [] #redhat_package_dependencies: []
@ -158,10 +158,6 @@ ceph_repository: rhcs
# for more info read: https://github.com/ceph/ceph-ansible/issues/305 # for more info read: https://github.com/ceph/ceph-ansible/issues/305
#ceph_stable_distro_source: "{{ ansible_distribution_release }}" #ceph_stable_distro_source: "{{ ansible_distribution_release }}"
# This option is needed for _both_ stable and dev version, so please always fill the right version
# # for supported distros, see http://download.ceph.com/rpm-{{ ceph_stable_release }}/
#ceph_stable_redhat_distro: el8
# REPOSITORY: RHCS VERSION RED HAT STORAGE (from 5.0) # REPOSITORY: RHCS VERSION RED HAT STORAGE (from 5.0)
# #

View File

@ -21,7 +21,7 @@
gpgcheck: yes gpgcheck: yes
state: present state: present
gpgkey: "{{ ceph_stable_key }}" gpgkey: "{{ ceph_stable_key }}"
baseurl: "{{ ceph_mirror }}/rpm-{{ ceph_stable_release }}/{{ ceph_stable_redhat_distro }}/$basearch" baseurl: "{{ ceph_mirror }}/rpm-{{ ceph_stable_release }}/el{{ ansible_distribution_major_version }}/$basearch"
file: ceph_stable file: ceph_stable
priority: 2 priority: 2
register: result register: result
@ -34,7 +34,7 @@
gpgcheck: yes gpgcheck: yes
state: present state: present
gpgkey: "{{ ceph_stable_key }}" gpgkey: "{{ ceph_stable_key }}"
baseurl: "{{ ceph_mirror }}/rpm-{{ ceph_stable_release }}/{{ ceph_stable_redhat_distro }}/noarch" baseurl: "{{ ceph_mirror }}/rpm-{{ ceph_stable_release }}/el{{ ansible_distribution_major_version }}/noarch"
file: ceph_stable file: ceph_stable
priority: 2 priority: 2
register: result register: result

View File

@ -1,12 +1,15 @@
--- ---
- name: install dnf-plugins-core - name: specific el 8 dependencies
when: ansible_distribution_major_version | int == 8
block:
- name: install dnf-plugins-core
package: package:
name: dnf-plugins-core name: dnf-plugins-core
register: result register: result
until: result is succeeded until: result is succeeded
tags: with_pkg tags: with_pkg
- name: enable ceph-el8 copr - name: enable ceph-el8 copr
command: dnf copr enable -y ktdreyer/ceph-el8 command: dnf copr enable -y ktdreyer/ceph-el8
args: args:
creates: /etc/yum.repos.d/_copr:copr.fedorainfracloud.org:ktdreyer:ceph-el8.repo creates: /etc/yum.repos.d/_copr:copr.fedorainfracloud.org:ktdreyer:ceph-el8.repo
@ -14,7 +17,7 @@
register: result register: result
until: result is succeeded until: result is succeeded
- name: enable ceph lab extras repository - name: enable ceph lab extras repository
yum_repository: yum_repository:
name: lab-extras name: lab-extras
baseurl: http://apt-mirror.front.sepia.ceph.com/lab-extras/8/ baseurl: http://apt-mirror.front.sepia.ceph.com/lab-extras/8/

View File

@ -78,7 +78,7 @@ debian_package_dependencies: []
centos_package_dependencies: centos_package_dependencies:
- epel-release - epel-release
- python3-libselinux - "{{ 'python3-libselinux' if ansible_distribution_major_version | int >= 8 else 'libselinux-python' }}"
redhat_package_dependencies: [] redhat_package_dependencies: []
@ -150,10 +150,6 @@ nfs_ganesha_stable_deb_repo: "{{ ceph_mirror }}/nfs-ganesha/deb-{{ nfs_ganesha_s
# for more info read: https://github.com/ceph/ceph-ansible/issues/305 # for more info read: https://github.com/ceph/ceph-ansible/issues/305
#ceph_stable_distro_source: "{{ ansible_distribution_release }}" #ceph_stable_distro_source: "{{ ansible_distribution_release }}"
# This option is needed for _both_ stable and dev version, so please always fill the right version
# # for supported distros, see http://download.ceph.com/rpm-{{ ceph_stable_release }}/
ceph_stable_redhat_distro: el8
# REPOSITORY: RHCS VERSION RED HAT STORAGE (from 5.0) # REPOSITORY: RHCS VERSION RED HAT STORAGE (from 5.0)
# #

View File

@ -23,8 +23,6 @@ ceph_mgr_modules: []
# Ceph mgr packages to install, ceph-mgr + extra module packages. # Ceph mgr packages to install, ceph-mgr + extra module packages.
ceph_mgr_packages: ceph_mgr_packages:
- ceph-mgr - ceph-mgr
- ceph-mgr-dashboard
- ceph-mgr-diskprediction-local
########## ##########

View File

@ -1,7 +1,7 @@
--- ---
- name: append dashboard modules to ceph_mgr_modules - name: append dashboard modules to ceph_mgr_modules
set_fact: set_fact:
ceph_mgr_modules: "{{ (ceph_mgr_modules + [ 'dashboard', 'prometheus' ]) | unique }}" ceph_mgr_modules: "{{ ceph_mgr_modules | union(['dashboard', 'prometheus']) }}"
when: dashboard_enabled | bool when: dashboard_enabled | bool
- name: wait for all mgr to be up - name: wait for all mgr to be up

View File

@ -6,6 +6,18 @@
- dashboard_enabled | bool - dashboard_enabled | bool
- ansible_distribution == 'RedHat' - ansible_distribution == 'RedHat'
- name: set_fact ceph_mgr_packages for dashboard
set_fact:
ceph_mgr_packages: "{{ ceph_mgr_packages | union(['ceph-mgr-dashboard']) }}"
when: dashboard_enabled | bool
- name: set_fact ceph_mgr_packages for non el7 distribution
set_fact:
ceph_mgr_packages: "{{ ceph_mgr_packages | union(['ceph-mgr-diskprediction-local']) }}"
when:
- ansible_os_family != 'RedHat'
- ansible_distribution_major_version | int != 7
- name: install ceph-mgr packages on RedHat or SUSE - name: install ceph-mgr packages on RedHat or SUSE
package: package:
name: '{{ ceph_mgr_packages }}' name: '{{ ceph_mgr_packages }}'

View File

@ -26,10 +26,12 @@
- name: fail on unsupported CentOS release - name: fail on unsupported CentOS release
fail: fail:
msg: "CentOS release not supported {{ ansible_distribution_major_version }}" msg: "CentOS release not supported {{ ansible_distribution_major_version }} with dashboard"
when: when:
- ansible_distribution == 'CentOS' - ansible_distribution == 'CentOS'
- ansible_distribution_major_version | int != 8 - ansible_distribution_major_version | int == 7
- not containerized_deployment | bool
- dashboard_enabled | true
- name: red hat based systems tasks - name: red hat based systems tasks
when: when:

View File

@ -17,7 +17,6 @@ def str_to_bool(val):
@pytest.fixture(scope="module") @pytest.fixture(scope="module")
def setup(host): def setup(host):
cluster_address = "" cluster_address = ""
container_binary = ""
osd_ids = [] osd_ids = []
osds = [] osds = []
@ -25,6 +24,7 @@ def setup(host):
ansible_facts = host.ansible("setup") ansible_facts = host.ansible("setup")
docker = ansible_vars.get("docker") docker = ansible_vars.get("docker")
container_binary = ansible_vars.get("container_binary", "")
osd_auto_discovery = ansible_vars.get("osd_auto_discovery") osd_auto_discovery = ansible_vars.get("osd_auto_discovery")
group_names = ansible_vars["group_names"] group_names = ansible_vars["group_names"]
fsid = ansible_vars.get("fsid") fsid = ansible_vars.get("fsid")
@ -63,7 +63,7 @@ def setup(host):
address = host.interface(public_interface).addresses[0] address = host.interface(public_interface).addresses[0]
if docker: if docker and not container_binary:
container_binary = "podman" container_binary = "podman"
data = dict( data = dict(

View File

@ -2,6 +2,7 @@
# this is only here to let the CI tests know # this is only here to let the CI tests know
# that this scenario is using docker # that this scenario is using docker
docker: True docker: True
container_binary: docker
containerized_deployment: True containerized_deployment: True
monitor_interface: "{{ 'eth1' if ansible_distribution == 'CentOS' else 'ens6' }}" monitor_interface: "{{ 'eth1' if ansible_distribution == 'CentOS' else 'ens6' }}"
@ -41,5 +42,4 @@ openstack_pools:
- "{{ openstack_cinder_pool }}" - "{{ openstack_cinder_pool }}"
handler_health_mon_check_delay: 10 handler_health_mon_check_delay: 10
handler_health_osd_check_delay: 10 handler_health_osd_check_delay: 10
dashboard_admin_password: $sX!cD$rYU6qR^B! dashboard_enabled: false
grafana_admin_password: +xFRe+RES@7vg24n

View File

@ -4,9 +4,6 @@ mon0
[osds] [osds]
osd0 osd0
[grafana-server]
mon0
[mgrs] [mgrs]
mon0 mon0