diff --git a/ansible/install/collectd.yml b/ansible/install/collectd.yml index ac8a3f316..8a2b25780 100644 --- a/ansible/install/collectd.yml +++ b/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'] diff --git a/ansible/install/group_vars/all.yml b/ansible/install/group_vars/all.yml index 31b62ce91..9940e9edc 100644 --- a/ansible/install/group_vars/all.yml +++ b/ansible/install/group_vars/all.yml @@ -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 diff --git a/ansible/install/pre-collectd.yml b/ansible/install/pre-collectd.yml new file mode 100644 index 000000000..3a31067f1 --- /dev/null +++ b/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) }}" diff --git a/doc/source/installation.rst b/doc/source/installation.rst index 4f20cc8b7..a5f04b594 100644 --- a/doc/source/installation.rst +++ b/doc/source/installation.rst @@ -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. ::