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
This commit is contained in:
Will Szumski 2021-01-18 17:07:56 +00:00
parent 031e337898
commit 25c33f9c94
2 changed files with 15 additions and 3 deletions

View File

@ -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:

View File

@ -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.