Fix Conditional Check for CephStorage plugin

This patch fixes the condition, so that fsid
is fetched only when ceph plugin is enabled.

Change-Id: I84ed3d8aa0c59b70b15ecf11cb15bc317daa7ec0
This commit is contained in:
Pradipta Sahoo 2024-05-07 16:34:33 +05:30
parent 8485df3535
commit 675c130c7a
2 changed files with 25 additions and 24 deletions

View File

@ -339,19 +339,20 @@
shell: ls /var/run/ceph/ceph-osd.*.asok | head -n 1 | egrep -o '[0-9]+' shell: ls /var/run/ceph/ceph-osd.*.asok | head -n 1 | egrep -o '[0-9]+'
register: cephstorage_osd_socket register: cephstorage_osd_socket
become: true become: true
when: "('CephStorage' in group_names and ceph_storage_collectd_plugin)" when: "(rhosp_version is version('17.0', '<')) and ('CephStorage' in group_names and ceph_storage_collectd_plugin)"
# End CephStorage OSD monitoring # End CephStorage OSD monitoring
- name: Get Ceph cluster fsid - block:
shell: ls /var/run/ceph/ - name: Get Ceph cluster fsid
register: ceph_cluster_fsid shell: ls /var/run/ceph/
become: true register: ceph_cluster_fsid
when: "rhosp_version is version('17.0', '>=')" become: true
delegate_to: controller-0 delegate_to: controller-0
- name: set fact for ceph cluster id - name: set fact for ceph cluster id
set_fact: set_fact:
ceph_cluster_fsid: "{{ ceph_cluster_fsid.stdout }}" ceph_cluster_fsid: "{{ ceph_cluster_fsid.stdout }}"
when: "(rhosp_version is version('17.0', '>=')) and ('CephStorage' in group_names and ceph_storage_collectd_plugin)"
- name: Configure collectd.conf - name: Configure collectd.conf
template: template:

View File

@ -165,22 +165,22 @@
when: "('CephStorage' in group_names and ceph_storage_collectd_plugin) and (rhosp_version is version('17.0', '<'))" when: "('CephStorage' in group_names and ceph_storage_collectd_plugin) and (rhosp_version is version('17.0', '<'))"
# End CephStorage OSD monitoring # End CephStorage OSD monitoring
- name: Get Ceph cluster fsid - block:
shell: ls /var/run/ceph/ - name: Get Ceph cluster fsid
register: ceph_cluster_fsid shell: ls /var/run/ceph/
become: true register: ceph_cluster_fsid
when: "rhosp_version is version('17.0', '>=')" become: true
delegate_to: controller-0 delegate_to: controller-0
- name: set fact for ceph cluster id - name: set fact for ceph cluster id
set_fact: set_fact:
ceph_cluster_fsid: "{{ ceph_cluster_fsid.stdout }}" ceph_cluster_fsid: "{{ ceph_cluster_fsid.stdout }}"
- name: Get 1st OSD socket - name: Get 1st OSD socket
shell: cephadm shell -- ls /var/run/ceph/ | head -n 1 | egrep -o '[0-9]+' shell: cephadm shell -- ls /var/run/ceph/ | head -n 1 | egrep -o '[0-9]+'
register: cephstorage_osd_socket register: cephstorage_osd_socket
become: true become: true
when: "('CephStorage' in group_names and ceph_storage_collectd_plugin) and (rhosp_version is version('17.0', '>='))" when: "(rhosp_version is version('17.0', '>=')) and ('CephStorage' in group_names and ceph_storage_collectd_plugin)"
- name: Create configuration directory - name: Create configuration directory
file: file: