diff --git a/ansible/install/roles/collectd-openstack/tasks/main.yml b/ansible/install/roles/collectd-openstack/tasks/main.yml index e58b6b354..d9787dd2d 100644 --- a/ansible/install/roles/collectd-openstack/tasks/main.yml +++ b/ansible/install/roles/collectd-openstack/tasks/main.yml @@ -339,19 +339,20 @@ shell: ls /var/run/ceph/ceph-osd.*.asok | head -n 1 | egrep -o '[0-9]+' register: cephstorage_osd_socket 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 -- name: Get Ceph cluster fsid - shell: ls /var/run/ceph/ - register: ceph_cluster_fsid - become: true - when: "rhosp_version is version('17.0', '>=')" - delegate_to: controller-0 +- block: + - name: Get Ceph cluster fsid + shell: ls /var/run/ceph/ + register: ceph_cluster_fsid + become: true + delegate_to: controller-0 -- name: set fact for ceph cluster id - set_fact: - ceph_cluster_fsid: "{{ ceph_cluster_fsid.stdout }}" + - name: set fact for ceph cluster id + set_fact: + 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 template: diff --git a/ansible/install/roles/collectd/tasks/main.yml b/ansible/install/roles/collectd/tasks/main.yml index 6efae3f6f..04df51941 100644 --- a/ansible/install/roles/collectd/tasks/main.yml +++ b/ansible/install/roles/collectd/tasks/main.yml @@ -165,22 +165,22 @@ when: "('CephStorage' in group_names and ceph_storage_collectd_plugin) and (rhosp_version is version('17.0', '<'))" # End CephStorage OSD monitoring -- name: Get Ceph cluster fsid - shell: ls /var/run/ceph/ - register: ceph_cluster_fsid - become: true - when: "rhosp_version is version('17.0', '>=')" - delegate_to: controller-0 +- block: + - name: Get Ceph cluster fsid + shell: ls /var/run/ceph/ + register: ceph_cluster_fsid + become: true + delegate_to: controller-0 -- name: set fact for ceph cluster id - set_fact: - ceph_cluster_fsid: "{{ ceph_cluster_fsid.stdout }}" + - name: set fact for ceph cluster id + set_fact: + ceph_cluster_fsid: "{{ ceph_cluster_fsid.stdout }}" -- name: Get 1st OSD socket - shell: cephadm shell -- ls /var/run/ceph/ | head -n 1 | egrep -o '[0-9]+' - register: cephstorage_osd_socket - become: true - when: "('CephStorage' in group_names and ceph_storage_collectd_plugin) and (rhosp_version is version('17.0', '>='))" + - name: Get 1st OSD socket + shell: cephadm shell -- ls /var/run/ceph/ | head -n 1 | egrep -o '[0-9]+' + register: cephstorage_osd_socket + become: true + when: "(rhosp_version is version('17.0', '>=')) and ('CephStorage' in group_names and ceph_storage_collectd_plugin)" - name: Create configuration directory file: