]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
Readd CentOS 7 with conditions
authorDimitri Savineau <dsavinea@redhat.com>
Thu, 2 Apr 2020 19:58:11 +0000 (15:58 -0400)
committerDimitri Savineau <savineau.dimitri@gmail.com>
Thu, 23 Apr 2020 20:07:14 +0000 (16:07 -0400)
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>
(cherry picked from commit 2547ab601a5187251f9dd41246d3dcedb653030f)

15 files changed:
group_vars/all.yml.sample
group_vars/mgrs.yml.sample
group_vars/rhcs.yml.sample
roles/ceph-common/tasks/installs/configure_el8_dep.yml
roles/ceph-common/tasks/installs/install_on_redhat.yml
roles/ceph-common/tasks/installs/redhat_community_repository.yml
roles/ceph-common/tasks/installs/redhat_dev_repository.yml
roles/ceph-defaults/defaults/main.yml
roles/ceph-mgr/defaults/main.yml
roles/ceph-mgr/tasks/mgr_modules.yml
roles/ceph-mgr/tasks/pre_requisite.yml
roles/ceph-validate/tasks/check_system.yml
tests/conftest.py
tests/functional/docker2podman/group_vars/all
tests/functional/docker2podman/hosts

index 8db176a5122ec2c915b29e5bea4970d5d2fb9ad7..2459d37083672d9019a61a3e00c4ff960be7afec 100644 (file)
@@ -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)
 #
index ab0d1116411b8a3549001b94a2e9ebf669eafc36..298525739875b1628d5c409e0d8c646754b3b22b 100644 (file)
@@ -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
 
 
 ##########
index a1faa76282807eb3fb18c94a6f1f0c87e1bbc01f..eebd0396cc015c03781d0f21b1c1e2e71d2fc2fb 100644 (file)
@@ -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)
 #
index b0fbd70aca370438e37e7e2fdf6a5632c4c45c3b..a9f264e78a8443881b9ec112caf04ceddb96da87 100644 (file)
@@ -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:
index 5a52d0f6b92004ee411af5a3ec41fdc5476cc18a..fd22187d0efb682ebc5e899f64fe14161727637d 100644 (file)
@@ -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
index aee8fffe9309296f7e47881db9e23aa9a84c984d..5fd817d75c97b6baa7911befafe20b95408417c3 100644 (file)
@@ -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
index 2cf0d3eaf69193b3f3b80c2cb6f9aced8953597b..2b767e9291ec933e3ff665f6b1f38e9e1fe9c8a3 100644 (file)
@@ -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
index 00c4cc4fa13c8669faada6f8b8584d8b06433bc2..0c161b46860fbff88f3105c68ff5301f72033c99 100644 (file)
@@ -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)
 #
index 053f623d7001a97bdaeabeb5095c856e2319c7e8..1165be45529b4a64191e16b1f96f0b1c226293b9 100644 (file)
@@ -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
 
 
 ##########
index 0d77d6fe3d57c0b0e8d1049489ec33767a8407b2..85ed88b0434cdd70c1de4a067a7792d7605d8344 100644 (file)
@@ -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
index 0cfe8d1fb8bfa11c918484fedbf544f32253817f..d57483b4354435e09096ec6f580e4a364a6160b9 100644 (file)
@@ -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 }}'
index 080a43d702e04e5c820135972a8249020cb8c435..9cf933fa894d713bbaae5fe043b52e805ce5843c 100644 (file)
 
 - 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:
index d386174279ff246f2364328c1f5ebbe9d1f96589..6853d64e47d015428329bd5a4ff0d00565ab2f65 100644 (file)
@@ -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(
index 222ebd1ea39ac92119a35c2f8c7472ef10b21890..2f7e7b4993797b76e10fcf3a4a2c53d988f8f626 100644 (file)
@@ -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
index 60e953a48cf3f07cab8a9843cfa8bf299c7acb90..b29e9111cc86e6738a093f826b47a8925c9da05e 100644 (file)
@@ -4,9 +4,6 @@ mon0
 [osds]
 osd0
 
-[grafana-server]
-mon0
-
 [mgrs]
 mon0