aboutsummaryrefslogtreecommitdiffstats
path: root/docker/ansible/roles
diff options
context:
space:
mode:
authorEmma Foley <efoley@redhat.com>2021-12-17 13:07:53 +0000
committerGerrit Code Review <gerrit@opnfv.org>2021-12-17 13:07:53 +0000
commit18206d429dd42701fc21f82c5dbc323e8b7b2eb5 (patch)
tree76954f5145b1937e32d00e11faf8944e9b7ca1da /docker/ansible/roles
parent1c7fea25a4084bafb52158c915e803b473ffbca0 (diff)
parent5cc8e3c94bdf62c5fd9838e4987d4e670d36f9ed (diff)
Merge changes from topic "collectd_6_testing"
* changes: Add a playbook that tests collectd 6 vs collectd5 [docker][ansible] Add a playbook for building the containers Create a flask app to show metrics from collectd
Diffstat (limited to 'docker/ansible/roles')
-rw-r--r--docker/ansible/roles/build_collectd/tasks/main.yml71
-rw-r--r--docker/ansible/roles/run_collectd/tasks/main.yml4
-rw-r--r--docker/ansible/roles/run_collectd/vars/main.yml1
3 files changed, 74 insertions, 2 deletions
diff --git a/docker/ansible/roles/build_collectd/tasks/main.yml b/docker/ansible/roles/build_collectd/tasks/main.yml
new file mode 100644
index 00000000..2ab92296
--- /dev/null
+++ b/docker/ansible/roles/build_collectd/tasks/main.yml
@@ -0,0 +1,71 @@
+# Copyright 2021 Anuket and others
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+---
+- name: Build stable container
+ docker_image:
+ name: opnfv/barometer-collectd
+ build:
+ path: "{{ playbook_dir }}/../barometer-collectd/"
+ source: build
+ tags:
+ - stable
+
+- name: Build the latest container
+ docker_image:
+ name: opnfv/barometer-collectd-latest
+ build:
+ path: "{{ playbook_dir }}/../../"
+ dockerfile: "docker/barometer-collectd-latest/Dockerfile"
+ source: build
+ tags:
+ - latest
+
+- name: Build collectd-experimental
+ docker_image:
+ name: opnfv/barometer-collectd-experimental
+ build:
+ path: "{{ playbook_dir }}/../../"
+ dockerfile: "docker/barometer-collectd-experimental/Dockerfile"
+ args:
+ COLLECTD_FLAVOR: experimental
+ COLLECTD_TAG: "{{ COLLECTD_TAG | default('main') }}"
+ COLLECTD_PULL_REQUESTS: "{{ COLLECTD_PULL_REQUESTS | default() }}"
+ source: build
+ tags:
+ - experimental
+
+- name: Build collectd-6
+ docker_image:
+ name: "opnfv/barometer-collectd-6{{ ( '-' + COLLECTD_PULL_REQUESTS ) if COLLECTD_PULL_REQUESTS is defined else '' }}"
+ build:
+ path: "{{ playbook_dir }}/../../"
+ dockerfile: "docker/barometer-collectd-experimental/Dockerfile"
+ args:
+ COLLECTD_FLAVOR: collectd-6
+ COLLECTD_TAG: "{{ COLLECTD_TAG | default('collectd-6.0') }}"
+ COLLECTD_CONFIG_CMD_ARGS: "{{ COLLECTD_CONFIG_CMD_ARGS if COLLECTD_CONFIG_CMD_ARGS is defined }}"
+ source: build
+ tags:
+ - collectd-6
+
+- name: Build test_app for write_http
+ docker_image:
+ name: test-collectd-write_http
+ build:
+ path: "{{ playbook_dir }}/../flask_app/"
+ source: build
+ tags:
+ - flask_test
+ - never
+
diff --git a/docker/ansible/roles/run_collectd/tasks/main.yml b/docker/ansible/roles/run_collectd/tasks/main.yml
index 2c5d0e67..bf5aabf5 100644
--- a/docker/ansible/roles/run_collectd/tasks/main.yml
+++ b/docker/ansible/roles/run_collectd/tasks/main.yml
@@ -15,7 +15,7 @@
- name: remove bar-collectd container
docker_container:
- name: bar-collectd
+ name: "{{ collectd_container_name }}"
state: absent
tags:
- rm_containers
@@ -52,7 +52,7 @@
- name: launch collectd container
docker_container:
- name: bar-collectd
+ name: "{{ collectd_container_name }}"
image: "{{ collectd_image_name }}"
volumes: "{{ volumes_list }}"
entrypoint: "/run_collectd.sh"
diff --git a/docker/ansible/roles/run_collectd/vars/main.yml b/docker/ansible/roles/run_collectd/vars/main.yml
index 96c9032e..26007ecf 100644
--- a/docker/ansible/roles/run_collectd/vars/main.yml
+++ b/docker/ansible/roles/run_collectd/vars/main.yml
@@ -13,6 +13,7 @@
# limitations under the License.
---
+collectd_container_name: "bar-collectd"
default_flavor: "{{ flavor|default('stable')|string }}"
flavor_image_name: "{{
'barometer-collectd-latest' if (default_flavor == 'master' or default_flavor == 'latest') else