Add dynamic group detection to openstack metrics

This change allows the larger os metrics installation process to be
selective. A dynamic group will be created and hosts will be added to it
when the host is within a known target group and is using systemd
(required for now).

Change-Id: I225ec5b5ffe4aa8ba403624f9ebe8c9eebed9fee
Signed-off-by: cloudnull <kevin@cloudnull.com>
This commit is contained in:
cloudnull 2019-02-19 13:18:55 -06:00 committed by Kevin Carter (cloudnull)
parent 22f997f7fa
commit faf940cbfc
1 changed files with 21 additions and 1 deletions

View File

@ -11,8 +11,28 @@
# See the License for the specific language governing permissions and
# limitations under the License.
- name: Detect monitorstack host deployment group(s)
hosts: "hosts:all_containers"
gather_facts: false
connection: local
tasks:
- name: Add hosts to dynamic inventory group
group_by:
key: monitorstack_deployment
parents: monitorstack_all
when:
- inventory_hostanme in (
(groups['nova_compute'] | default([])) |
union(groups['utility_all'] | default([])) |
union(groups['memcached_all'] | default([])) |
union(groups['memcached_all'] | default([]))
)
- ansible_service_mgr == 'systemd'
tags:
- always
- name: Install MonitorStack
hosts: "nova_compute:utility_all:memcached_all"
hosts: monitorstack_all
become: true
gather_facts: true
vars: