From 97a1f9859126173116ae0f14f3c931bc7da2b51c Mon Sep 17 00:00:00 2001 From: nicolas-f <1382241+nicolas-f@users.noreply.github.com> Date: Mon, 29 Jan 2024 17:32:29 +0100 Subject: [PATCH] Update parse_to_elasticsearch.yml --- services/ansible_openvpn/playbooks/parse_to_elasticsearch.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/ansible_openvpn/playbooks/parse_to_elasticsearch.yml b/services/ansible_openvpn/playbooks/parse_to_elasticsearch.yml index 6a379f3..ddab5fa 100644 --- a/services/ansible_openvpn/playbooks/parse_to_elasticsearch.yml +++ b/services/ansible_openvpn/playbooks/parse_to_elasticsearch.yml @@ -3,7 +3,7 @@ connection: local vars: source: '/home/semaphore/data/to_process/' - destination: '/home/semaphore/data/archive/{{ ansible_date_time.year }}_{{ ansible_date_time.iso8601|slice("W")|int }}/' + destination: '/home/semaphore/data/archive/' api_key: "{{ lookup('ansible.builtin.env', 'ELASTIC_SEARCH_API_KEY') }}" api_key_id: "{{ lookup('ansible.builtin.env', 'ELASTIC_SEARCH_API_KEY_ID') }}" tasks: @@ -18,7 +18,7 @@ delegate_to: localhost - name: Launch python script from playbook ansible.builtin.script: - cmd: scripts_elasticsearch/feed_rpi_data.py --host https://es01:9200 --json_input_folder '{{ source }}' --api_key '{{ api_key }}' --api_key_id '{{ api_key_id }}' --json_archive_folder '{{ destination }}' -v + cmd: scripts_elasticsearch/feed_rpi_data.py --host https://es01:9200 --json_input_folder '{{ source }}' --api_key '{{ api_key }}' --api_key_id '{{ api_key_id }}' --json_archive_folder '{{ destination }}/$(echo $(date +"%Y-%W"))/' -v args: executable: python3 register: result