From: Dimitri Savineau Date: Thu, 2 Apr 2020 19:58:11 +0000 (-0400) Subject: Readd CentOS 7 with conditions X-Git-Tag: v5.0.0~40 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=8a10918e49e6949669d7c6923616f52496b7ca99;p=ceph-ansible.git 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 (cherry picked from commit 2547ab601a5187251f9dd41246d3dcedb653030f) --- diff --git a/group_vars/all.yml.sample b/group_vars/all.yml.sample index 8db176a51..2459d3708 100644 --- a/group_vars/all.yml.sample +++ b/group_vars/all.yml.sample @@ -86,7 +86,7 @@ dummy: #centos_package_dependencies: # - epel-release -# - python3-libselinux +# - "{{ 'python3-libselinux' if ansible_distribution_major_version | int >= 8 else 'libselinux-python' }}" #redhat_package_dependencies: [] @@ -158,10 +158,6 @@ dummy: # for more info read: https://github.com/ceph/ceph-ansible/issues/305 #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) # diff --git a/group_vars/mgrs.yml.sample b/group_vars/mgrs.yml.sample index ab0d11164..298525739 100644 --- a/group_vars/mgrs.yml.sample +++ b/group_vars/mgrs.yml.sample @@ -31,8 +31,6 @@ dummy: # Ceph mgr packages to install, ceph-mgr + extra module packages. #ceph_mgr_packages: # - ceph-mgr -# - ceph-mgr-dashboard -# - ceph-mgr-diskprediction-local ########## diff --git a/group_vars/rhcs.yml.sample b/group_vars/rhcs.yml.sample index a1faa7628..eebd0396c 100644 --- a/group_vars/rhcs.yml.sample +++ b/group_vars/rhcs.yml.sample @@ -86,7 +86,7 @@ fetch_directory: ~/ceph-ansible-keys #centos_package_dependencies: # - epel-release -# - python3-libselinux +# - "{{ 'python3-libselinux' if ansible_distribution_major_version | int >= 8 else 'libselinux-python' }}" #redhat_package_dependencies: [] @@ -158,10 +158,6 @@ ceph_repository: rhcs # for more info read: https://github.com/ceph/ceph-ansible/issues/305 #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) # diff --git a/roles/ceph-common/tasks/installs/configure_el8_dep.yml b/roles/ceph-common/tasks/installs/configure_el8_dep.yml index b0fbd70ac..a9f264e78 100644 --- a/roles/ceph-common/tasks/installs/configure_el8_dep.yml +++ b/roles/ceph-common/tasks/installs/configure_el8_dep.yml @@ -1,4 +1,11 @@ --- +- name: install dnf-plugins-core + package: + name: dnf-plugins-core + register: result + until: result is succeeded + tags: with_pkg + - name: enable ceph-el8 copr command: dnf copr enable -y ktdreyer/ceph-el8 args: diff --git a/roles/ceph-common/tasks/installs/install_on_redhat.yml b/roles/ceph-common/tasks/installs/install_on_redhat.yml index 5a52d0f6b..fd22187d0 100644 --- a/roles/ceph-common/tasks/installs/install_on_redhat.yml +++ b/roles/ceph-common/tasks/installs/install_on_redhat.yml @@ -1,7 +1,9 @@ --- - name: include configure_el8_dep.yml include_tasks: configure_el8_dep.yml - when: ceph_origin == 'repository' + when: + - ceph_origin == 'repository' + - ansible_distribution_major_version | int == 8 - name: include configure_redhat_repository_installation.yml include_tasks: configure_redhat_repository_installation.yml diff --git a/roles/ceph-common/tasks/installs/redhat_community_repository.yml b/roles/ceph-common/tasks/installs/redhat_community_repository.yml index aee8fffe9..5fd817d75 100644 --- a/roles/ceph-common/tasks/installs/redhat_community_repository.yml +++ b/roles/ceph-common/tasks/installs/redhat_community_repository.yml @@ -21,7 +21,7 @@ gpgcheck: yes state: present 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 priority: 2 register: result @@ -34,7 +34,7 @@ gpgcheck: yes state: present 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 priority: 2 register: result diff --git a/roles/ceph-common/tasks/installs/redhat_dev_repository.yml b/roles/ceph-common/tasks/installs/redhat_dev_repository.yml index 2cf0d3eaf..2b767e929 100644 --- a/roles/ceph-common/tasks/installs/redhat_dev_repository.yml +++ b/roles/ceph-common/tasks/installs/redhat_dev_repository.yml @@ -1,11 +1,4 @@ --- -- name: install dnf-plugins-core - package: - name: dnf-plugins-core - register: result - until: result is succeeded - tags: with_pkg - - name: fetch ceph red hat development repository uri: # Use the centos repo since we don't currently have a dedicated red hat repo diff --git a/roles/ceph-defaults/defaults/main.yml b/roles/ceph-defaults/defaults/main.yml index 00c4cc4fa..0c161b468 100644 --- a/roles/ceph-defaults/defaults/main.yml +++ b/roles/ceph-defaults/defaults/main.yml @@ -78,7 +78,7 @@ debian_package_dependencies: [] centos_package_dependencies: - epel-release - - python3-libselinux + - "{{ 'python3-libselinux' if ansible_distribution_major_version | int >= 8 else 'libselinux-python' }}" 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 #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) # diff --git a/roles/ceph-mgr/defaults/main.yml b/roles/ceph-mgr/defaults/main.yml index 053f623d7..1165be455 100644 --- a/roles/ceph-mgr/defaults/main.yml +++ b/roles/ceph-mgr/defaults/main.yml @@ -23,8 +23,6 @@ ceph_mgr_modules: [] # Ceph mgr packages to install, ceph-mgr + extra module packages. ceph_mgr_packages: - ceph-mgr - - ceph-mgr-dashboard - - ceph-mgr-diskprediction-local ########## diff --git a/roles/ceph-mgr/tasks/mgr_modules.yml b/roles/ceph-mgr/tasks/mgr_modules.yml index 0d77d6fe3..85ed88b04 100644 --- a/roles/ceph-mgr/tasks/mgr_modules.yml +++ b/roles/ceph-mgr/tasks/mgr_modules.yml @@ -1,7 +1,7 @@ --- - name: append dashboard modules to ceph_mgr_modules set_fact: - ceph_mgr_modules: "{{ (ceph_mgr_modules + [ 'dashboard', 'prometheus' ]) | unique }}" + ceph_mgr_modules: "{{ ceph_mgr_modules | union(['dashboard', 'prometheus']) }}" when: dashboard_enabled | bool - name: wait for all mgr to be up diff --git a/roles/ceph-mgr/tasks/pre_requisite.yml b/roles/ceph-mgr/tasks/pre_requisite.yml index 0cfe8d1fb..d57483b43 100644 --- a/roles/ceph-mgr/tasks/pre_requisite.yml +++ b/roles/ceph-mgr/tasks/pre_requisite.yml @@ -6,6 +6,18 @@ - dashboard_enabled | bool - 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 package: name: '{{ ceph_mgr_packages }}' diff --git a/roles/ceph-validate/tasks/check_system.yml b/roles/ceph-validate/tasks/check_system.yml index 080a43d70..9cf933fa8 100644 --- a/roles/ceph-validate/tasks/check_system.yml +++ b/roles/ceph-validate/tasks/check_system.yml @@ -26,10 +26,12 @@ - name: fail on unsupported CentOS release fail: - msg: "CentOS release not supported {{ ansible_distribution_major_version }}" + msg: "CentOS release not supported {{ ansible_distribution_major_version }} with dashboard" when: - 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 when: diff --git a/tests/conftest.py b/tests/conftest.py index d38617427..6853d64e4 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -17,7 +17,6 @@ def str_to_bool(val): @pytest.fixture(scope="module") def setup(host): cluster_address = "" - container_binary = "" osd_ids = [] osds = [] @@ -25,6 +24,7 @@ def setup(host): ansible_facts = host.ansible("setup") docker = ansible_vars.get("docker") + container_binary = ansible_vars.get("container_binary", "") osd_auto_discovery = ansible_vars.get("osd_auto_discovery") group_names = ansible_vars["group_names"] fsid = ansible_vars.get("fsid") @@ -63,7 +63,7 @@ def setup(host): address = host.interface(public_interface).addresses[0] - if docker: + if docker and not container_binary: container_binary = "podman" data = dict( diff --git a/tests/functional/docker2podman/group_vars/all b/tests/functional/docker2podman/group_vars/all index 222ebd1ea..2f7e7b499 100644 --- a/tests/functional/docker2podman/group_vars/all +++ b/tests/functional/docker2podman/group_vars/all @@ -2,6 +2,7 @@ # this is only here to let the CI tests know # that this scenario is using docker docker: True +container_binary: docker containerized_deployment: True monitor_interface: "{{ 'eth1' if ansible_distribution == 'CentOS' else 'ens6' }}" @@ -41,5 +42,4 @@ openstack_pools: - "{{ openstack_cinder_pool }}" handler_health_mon_check_delay: 10 handler_health_osd_check_delay: 10 -dashboard_admin_password: $sX!cD$rYU6qR^B! -grafana_admin_password: +xFRe+RES@7vg24n \ No newline at end of file +dashboard_enabled: false \ No newline at end of file diff --git a/tests/functional/docker2podman/hosts b/tests/functional/docker2podman/hosts index 60e953a48..b29e9111c 100644 --- a/tests/functional/docker2podman/hosts +++ b/tests/functional/docker2podman/hosts @@ -4,9 +4,6 @@ mon0 [osds] osd0 -[grafana-server] -mon0 - [mgrs] mon0