From 44d5d79394e29d783a7ef73ba742052d97fad124 Mon Sep 17 00:00:00 2001 From: Emma Foley Date: Thu, 10 Jun 2021 12:04:23 +0100 Subject: [ansible] Use collectd_config for virt and rdt Only one of virt and intel_rdt can be enabled at a time, and the existing checks are based on the existance of a {rdt,virt}.conf file to determine whether the other plugin is enabled. This check needed updating, and is now based on whether the other plugin is in the collectd_plugins value. Signed-off-by: Emma Foley Change-Id: I175d60111bf133965e1ecbf3764cb12a25356576 --- docker/ansible/roles/config_files/tasks/virt.yml | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'docker/ansible/roles/config_files/tasks/virt.yml') diff --git a/docker/ansible/roles/config_files/tasks/virt.yml b/docker/ansible/roles/config_files/tasks/virt.yml index 7fb0bb92..75a17a18 100644 --- a/docker/ansible/roles/config_files/tasks/virt.yml +++ b/docker/ansible/roles/config_files/tasks/virt.yml @@ -1,4 +1,4 @@ -#Copyright 2018 OPNFV and Intel Corporation +# Copyright 2018-21 Anuket, Intel Corporation and others # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -21,16 +21,14 @@ - virt - name: (virt) check if rdt is enabled - stat: - path: "{{ config_file_dir }}/rdt.conf" - register: rdt_file + set_fact: + rdt_enabled: true tags: - - virt + - rdt - name: enable virt plugin - template: - src: virt.conf.j2 - dest: "{{ config_file_dir }}/virt.conf" - when: libvirt_result is succeeded and rdt_file.stat.exists == False + set_fact: + collectd_plugins: "{{ collectd_plugins | union(['virt']) | unique }}" + when: libvirt_result is succeeded and not (rdt_enabled | default(false)) tags: - virt -- cgit 1.2.3-korg