diff --git a/ansible/install/group_vars/all.yml b/ansible/install/group_vars/all.yml index 07ac6a798..7a84e7c76 100644 --- a/ansible/install/group_vars/all.yml +++ b/ansible/install/group_vars/all.yml @@ -152,6 +152,12 @@ collectd_objectstorage: true collectd_cephstorage: true collectd_compute: false +####################################### +# OSP15 Collectd Configuration +###################################### +rhos_release_rpm: +osp_release: 15 + # Opt-In Collectd plugins configuration: ######################## # Apache plugin diff --git a/ansible/install/group_vars/zuul_all.yml b/ansible/install/group_vars/zuul_all.yml index 90342056c..5356ea0ce 100644 --- a/ansible/install/group_vars/zuul_all.yml +++ b/ansible/install/group_vars/zuul_all.yml @@ -152,6 +152,12 @@ collectd_objectstorage: true collectd_cephstorage: true collectd_compute: false +####################################### +# OSP15 Collectd Configuration +####################################### +rhos_release_rpm: +osp_release: 15 + # Opt-In Collectd plugins configuration: ######################## # Apache plugin diff --git a/ansible/install/roles/collectd-openstack/tasks/main.yml b/ansible/install/roles/collectd-openstack/tasks/main.yml index 21b156185..bfe59221f 100644 --- a/ansible/install/roles/collectd-openstack/tasks/main.yml +++ b/ansible/install/roles/collectd-openstack/tasks/main.yml @@ -15,18 +15,25 @@ - collectd-ceph - collectd-mysql - collectd-turbostat - when: collectd_from_epel + when: collectd_from_epel and ansible_distribution_major_version < '8' - name: Clean Non-EPEL collectd configuration shell: "rm -rf /etc/collectd.d/*.conf" become: true - when: collectd_from_epel + when: collectd_from_epel and ansible_distribution_major_version < '8' + +- name: Enable OSP repos for controller, compute + shell: | + dnf install -y {{ rhos_release_rpm }} + rhos-release {{ osp_release }} + when: "('controller' in group_names) or ('compute' in group_names) and ansible_distribution_major_version == '8'" + become: yes # # (akrzos) yum module works at this point due to the fact the EPEL repo now exists. EPEL rpm is # installed at this point in time. # -- name: Install collectd rpms +- name: Install collectd rpms for centos yum: name: "{{ item }}" state: present @@ -40,7 +47,27 @@ - collectd-mysql - collectd-ping - collectd-turbostat - when: collectd_from_epel + when: collectd_from_epel and ansible_distribution_major_version < '8' + +# +# (zul) Remove rhelosp15-0-brew when EPEL 8 exists +# +- name: Install collectd rpms for centos + dnf: + name: "{{ item }}" + state: present + enablerepo: "rhelosp-15.0-brew, rhelosp-15.0-trunk-brew" + become: true + with_items: + - collectd + - collectd-apache + - collectd-ceph + - collectd-mysql + - collectd-ping + - collectd-turbostat + - collectd-disk + - collectd-python + when: ansible_distribution_major_version == '8' # (sai) Since we moved to containers we don't have java installed on the host # anymore but it is needed for collectd-java @@ -52,13 +79,14 @@ enabled: yes become: true register: repo_add - when: ('controller' in group_names and opendaylight_java_plugin) + when: ('controller' in group_names and opendaylight_java_plugin and ansible_distribution_major_version < '8') - name: Add key rpm_key: state: present key: https://www.centos.org/keys/RPM-GPG-KEY-CentOS-7 become: true + when: ansible_distribution_major_version < '8' # (sai) Separating out collectd java rpms as they have a lot of dependencies and # are only required for ODL monitoring on controllers only @@ -71,14 +99,14 @@ - java-1.8.0-openjdk - collectd-java - collectd-generic-jmx - when: (repo_add is success and 'controller' in group_names and opendaylight_java_plugin) + when: (repo_add is success and 'controller' in group_names and opendaylight_java_plugin and ansible_distribution_major_version < '8') - name: Remove repository yum_repository: name: CentOS-7-Base state: absent become: true - when: (repo_add is success and 'controller' in group_names and opendaylight_java_plugin) + when: (repo_add is success and 'controller' in group_names and opendaylight_java_plugin and ansible_distribution_major_version < '8') # Iostat plugin requires sysstat since shelling iostat for stats, Also it is # handy to have sysstat.