Parametrize file_list parameter config parameter

The host administrator might want to change the file_list parameter
to own one. Currently, the path and filename was hard coded, but
with that commit, it can be added as a parameter.

Change-Id: If920978f8df3536ba8a65228350d41706d5d1243
This commit is contained in:
Daniel Pawlik
2023-11-30 12:05:23 +01:00
parent 06cc752dbf
commit a5754ef11c
6 changed files with 8 additions and 2 deletions

View File

@@ -28,6 +28,7 @@ for example:
zuul_api_url:
- https://zuul.opendev.org/api/tenant/openstack
insecure: false
file_list: /etc/logscraper/download-list-TENANT.yaml
will deploy service with name: `logscraper@openstack.service`.
It is because on one service we are able to deploy multiple instances
@@ -67,6 +68,7 @@ and second one for getting logs from `sometenant` tenant.
insecure: True
download: true
download_dir: /mnt/logscraper
file_list: /etc/logscraper/my-downloadlist.yaml
roles:
- logscraper

View File

@@ -6,7 +6,7 @@ workers: {{ item['logscraper_workers'] | default(1) }}
max_skipped: {{ item['max_skipped'] | default(1000) }}
debug: {{ item['debug'] | default(false) }}
download: {{ item['download'] | default(true) }}
file_list: {{ logscraper_dir }}/download-list-{{ item['tenant'] }}.yaml
file_list: {{ item['file_list'] | default(logscraper_dir + '/download-list-' + item['tenant'] + '.yaml') }}
directory: {{ item['download_dir'] | default('/tmp/logscraper') }}
wait_time: {{ item['logscraper_wait_time'] | default(120) }}
insecure: {{ item['insecure'] | default(false) }}

View File

@@ -8,6 +8,7 @@
--uidmap 1000:{{ logscraper_uid }}:1 \
--name logscraper-{{ item.tenant }} \
--volume {{ item.logscraper_dir | default(logscraper_dir) }}:{{ logscraper_dir }}:z \
--volume {{ item['file_list'] | default(logscraper_dir + '/download-list-' + item['tenant'] + '.yaml') }}:{{ item['file_list'] | default(logscraper_dir + '/download-list-' + item['tenant'] + '.yaml') }}:z \
{% if 'logscraper_custom_ca_crt' in item %}
--volume {{ item['logscraper_custom_ca_crt'] }}:{{ item['logscraper_custom_ca_crt'] }}:z \
{% endif %}

View File

@@ -30,6 +30,7 @@ Example Ansible variables that are configuring service:
es_insecure: true
es_index: logstash-logscraper
download_dir: /mnt/logscraper/sometenant
file_list: /etc/logsender/download-list-TENANT.yaml
That configuration will will deploy service with name: `logsender-openstack.service`.
@@ -75,6 +76,7 @@ and second one for getting logs from `sometenant` tenant.
es_index: ""
es_index_prefix: ""
download_dir: /mnt/logscraper/sometenant
file_list: /etc/logscraper/my-downloadlist.yaml
roles:
- logsender

View File

@@ -16,6 +16,6 @@ follow: {{ item['follow'] | default(true) }}
workers: {{ item['logsender_workers'] | default(1) }}
ignore_es_status: {{ item['ignore_es_status'] | default(false) }}
directory: {{ item['download_dir'] | default('/tmp/logscraper') }}
file_list: {{ logscraper_dir }}/download-list-{{ item['tenant'] }}.yaml
file_list: {{ item['file_list'] | default(logscraper_dir + '/download-list-' + item['tenant'] + '.yaml') }}
performance_index_prefix: {{ item['performance_index_prefix'] | default('') }}
subunit_index_prefix: {{ item['subunit_index_prefix'] | default('') }}

View File

@@ -9,6 +9,7 @@
--name logsender-{{ item.tenant }} \
--volume {{ item.download_dir }}:{{ item.download_dir }}:z \
--volume {{ item.logscraper_dir | default(logscraper_dir) }}:{{ logscraper_dir }}:z \
--volume {{ item['file_list'] | default(logscraper_dir + '/download-list-' + item['tenant'] + '.yaml') }}:{{ item['file_list'] | default(logscraper_dir + '/download-list-' + item['tenant'] + '.yaml') }}:z \
{% if 'logsender_custom_ca_crt' in item %}
--volume {{ item['logsender_custom_ca_crt'] }}:{{ item['logsender_custom_ca_crt'] }}:z \
{% endif %}