From 1d36adcb4ffc64df3fc7f1a1488bff02acf9b40f Mon Sep 17 00:00:00 2001 From: Xinliang Liu Date: Fri, 15 Dec 2017 10:18:38 +0800 Subject: [PATCH] Make fluentd enabled configurable Although there is an option "enable_fluentd", but there are still some tasks that make fluentd not configurable. Change-Id: Ic0a9deb36fce154022925d26411e01a8ffe18b50 Signed-off-by: Xinliang Liu --- ansible/roles/common/tasks/config.yml | 4 ++++ ansible/roles/common/tasks/pull.yml | 2 ++ 2 files changed, 6 insertions(+) diff --git a/ansible/roles/common/tasks/config.yml b/ansible/roles/common/tasks/config.yml index a9dd36f8e7..7a973c9486 100644 --- a/ansible/roles/common/tasks/config.yml +++ b/ansible/roles/common/tasks/config.yml @@ -80,12 +80,16 @@ pattern: "*.conf" run_once: True register: find_custom_fluentd_outputs + when: + - enable_fluentd | bool - name: Copying over custom fluentd output config files template: src: "{{ item.path }}" dest: "{{ node_config_directory }}/fluentd/output/{{ item.path | basename }}" register: fluentd_output_custom + when: + - enable_fluentd | bool with_items: "{{ find_custom_fluentd_outputs.files }}" notify: - Restart fluentd container diff --git a/ansible/roles/common/tasks/pull.yml b/ansible/roles/common/tasks/pull.yml index ac648a0f2d..9eb75ae987 100644 --- a/ansible/roles/common/tasks/pull.yml +++ b/ansible/roles/common/tasks/pull.yml @@ -4,4 +4,6 @@ action: "pull_image" common_options: "{{ docker_common_options }}" image: "{{ item.value.image }}" + when: + - item.value.enabled | bool with_dict: "{{ common_services }}"