From 25c33f9c9477c3a7b5f48a50157b16b1b7c595b1 Mon Sep 17 00:00:00 2001 From: Will Szumski Date: Mon, 18 Jan 2021 17:07:56 +0000 Subject: [PATCH] Make it possible to override automatic fluentd version detection One use case for this is so that you can generate config in a CI job without access to the container repository. It also removes the dependency of having docker configured for config generation. TrivialFix Change-Id: I0d388851c8b953af0494e44ae569e7eb9e15c326 --- ansible/roles/common/tasks/config.yml | 12 +++++++++--- ...l-fluentd-version-detection-3cb8b8a8ebc02d0a.yaml | 6 ++++++ 2 files changed, 15 insertions(+), 3 deletions(-) create mode 100644 releasenotes/notes/optional-fluentd-version-detection-3cb8b8a8ebc02d0a.yaml diff --git a/ansible/roles/common/tasks/config.yml b/ansible/roles/common/tasks/config.yml index d5071b1899..3fa0f8c193 100644 --- a/ansible/roles/common/tasks/config.yml +++ b/ansible/roles/common/tasks/config.yml @@ -33,7 +33,9 @@ action: "ensure_image" common_options: "{{ docker_common_options }}" image: "{{ service.image }}" - when: service | service_enabled_and_mapped_to_host + when: + - fluentd_version is not defined or fluentd_binary is not defined + - service | service_enabled_and_mapped_to_host - name: Fetch fluentd image labels vars: @@ -43,12 +45,16 @@ docker_image_info: name: "{{ service.image }}" register: fluentd_labels - when: service | service_enabled_and_mapped_to_host + when: + - fluentd_version is not defined or fluentd_binary is not defined + - service | service_enabled_and_mapped_to_host - name: Set fluentd facts set_fact: fluentd_binary: "{{ fluentd_labels.images.0.ContainerConfig.Labels.fluentd_binary }}" - when: common_services.fluentd | service_enabled_and_mapped_to_host + when: + - fluentd_binary is not defined + - common_services.fluentd | service_enabled_and_mapped_to_host - include_tasks: copy-certs.yml when: diff --git a/releasenotes/notes/optional-fluentd-version-detection-3cb8b8a8ebc02d0a.yaml b/releasenotes/notes/optional-fluentd-version-detection-3cb8b8a8ebc02d0a.yaml new file mode 100644 index 0000000000..a374924a3e --- /dev/null +++ b/releasenotes/notes/optional-fluentd-version-detection-3cb8b8a8ebc02d0a.yaml @@ -0,0 +1,6 @@ +--- +features: + - | + Adds the ability to override the automatic detection of `fluentd_version` + and `fluentd_binary`. These can now be defined as extra variables. This + removes the dependency of having docker configured for config generation.