Skip to content

Commit

Permalink
Automate collectd_container var
Browse files Browse the repository at this point in the history
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
  • Loading branch information
asyedham committed Oct 23, 2020
1 parent 2928e19 commit 02e56b8
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
8 changes: 5 additions & 3 deletions ansible/install/collectd.yml
@@ -1,9 +1,11 @@
---
- name: set fact collectd_container
import_playbook: pre-collectd.yml

- name: Run containerized collectd (Stein and greater recommended)
import_playbook: collectd-container.yml
when: collectd_container
when: hostvars['undercloud']['collectd_container']

- name: Run collectd installed through RPMs
import_playbook: collectd-baremetal.yml
when: not collectd_container

when: not hostvars['undercloud']['collectd_container']
2 changes: 0 additions & 2 deletions ansible/install/group_vars/all.yml
Expand Up @@ -144,8 +144,6 @@ repos: {}
# Collectd Configuration
########################################
# Install release specific templates
# Set collectd_container true for OSP >= 15
collectd_container: true
# Install collectd from EPEL
collectd_from_epel: true
# Interval in seconds
Expand Down
8 changes: 8 additions & 0 deletions ansible/install/pre-collectd.yml
@@ -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) }}"
3 changes: 1 addition & 2 deletions doc/source/installation.rst
Expand Up @@ -82,8 +82,7 @@ has been installed. To skip directly to this task execute:
(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
can also work with Queens release but it is not recommended.
``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.

::

Expand Down

0 comments on commit 02e56b8

Please sign in to comment.