Automate collectd_container var

This patch automates collectd_container var to set to true  if running on OpenStack version
Stein or later and set to false for below OpenStack version which was manually done earlier.

Change-Id: Idd61f060a088caa1eae9d2a80e3c7ceb5debc424
This commit is contained in:
Asma Syed Hameed
2020-09-04 12:46:12 +05:30
parent 2928e1951f
commit 02e56b8258
4 changed files with 14 additions and 7 deletions

View File

@@ -1,9 +1,11 @@
--- ---
- name: set fact collectd_container
import_playbook: pre-collectd.yml
- name: Run containerized collectd (Stein and greater recommended) - name: Run containerized collectd (Stein and greater recommended)
import_playbook: collectd-container.yml import_playbook: collectd-container.yml
when: collectd_container when: hostvars['undercloud']['collectd_container']
- name: Run collectd installed through RPMs - name: Run collectd installed through RPMs
import_playbook: collectd-baremetal.yml import_playbook: collectd-baremetal.yml
when: not collectd_container when: not hostvars['undercloud']['collectd_container']

View File

@@ -144,8 +144,6 @@ repos: {}
# Collectd Configuration # Collectd Configuration
######################################## ########################################
# Install release specific templates # Install release specific templates
# Set collectd_container true for OSP >= 15
collectd_container: true
# Install collectd from EPEL # Install collectd from EPEL
collectd_from_epel: true collectd_from_epel: true
# Interval in seconds # Interval in seconds

View File

@@ -0,0 +1,8 @@
---
- hosts: undercloud
roles:
- { role: osp_version }
tasks:
- name: set fact collectd_container
set_fact:
collectd_container: "{{ (rhosp_major|int > 14)| ternary(true, false) }}"

View File

@@ -82,8 +82,7 @@ has been installed. To skip directly to this task execute:
(Optional) Install Collectd (Optional) Install Collectd
~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
Set ``collectd_container`` to true in ``ansible/install/group_vars/all.yml`` if running on OpenStack version Stein or later. The containerized collectd work ``collectd_container`` is set to true if running on OpenStack version Stein or later. The containerized collectd can also work with Queens release but it is not recommended.
can also work with Queens release but it is not recommended.
:: ::