aboutsummaryrefslogtreecommitdiffstats
path: root/docker/ansible/roles
diff options
context:
space:
mode:
authorMatthias Runge <mrunge@redhat.com>2019-12-13 07:42:36 +0000
committerGerrit Code Review <gerrit@opnfv.org>2019-12-13 07:42:36 +0000
commit3c47290b9a08d836c6d648ee08d3ca9fe3401f8f (patch)
tree80c93e6608cc6e4b7d8ec5e33c4fc390523bfde3 /docker/ansible/roles
parent6afde5454ff335c1f1050905a6d171e76712cfd3 (diff)
parent3b7264dea083281fe8cca20cf4ee9829ea1e8c49 (diff)
Merge "Fix the Makefile for intel-cmt-cat so it can be build without errors on CentOS 7. Mount the /sys/fs/resctrl from host to container to avoid issues with intel_rdt plugin."
Diffstat (limited to 'docker/ansible/roles')
-rw-r--r--docker/ansible/roles/run_collectd/tasks/main.yml25
1 files changed, 20 insertions, 5 deletions
diff --git a/docker/ansible/roles/run_collectd/tasks/main.yml b/docker/ansible/roles/run_collectd/tasks/main.yml
index 744c7a77..8fc27342 100644
--- a/docker/ansible/roles/run_collectd/tasks/main.yml
+++ b/docker/ansible/roles/run_collectd/tasks/main.yml
@@ -31,15 +31,30 @@
- rm_collectd_image
when: rm_images|default(false)|bool == true
-- name: launch collectd container
- docker_container:
- name: bar-collectd
- image: "{{ collectd_image_name }}"
- volumes:
+- name: check if /sys/fs/resctrl exist
+ stat:
+ path: /sys/fs/resctrl
+ register: resctrl_dir
+
+- name: set list of volumes to bind
+ set_fact:
+ volumes_list:
+
- /opt/collectd/etc/collectd.conf.d/:/opt/collectd/etc/collectd.conf.d
- /var/run:/var/run
- /tmp:/tmp
- /var/lib/collectd:/var/lib/collectd
+
+- name: add resctrl to container volumes
+ set_fact:
+ volumes_list: "{{ volumes_list + [ '/sys/fs/resctrl:/sys/fs/resctrl' ] }}"
+ when: resctrl_dir.stat.exists
+
+- name: launch collectd container
+ docker_container:
+ name: bar-collectd
+ image: "{{ collectd_image_name }}"
+ volumes: "{{ volumes_list }}"
command: "/run_collectd.sh"
detach: yes
state: started