From 68ab0aa1ec28b55140607646eceab3c4fa4a021e Mon Sep 17 00:00:00 2001 From: sebclem Date: Fri, 17 Dec 2021 12:22:43 +0100 Subject: [PATCH] Fix install --- tasks/install.yml | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/tasks/install.yml b/tasks/install.yml index 467c5c2..6c53971 100644 --- a/tasks/install.yml +++ b/tasks/install.yml @@ -27,7 +27,7 @@ - "{{ loki_storage_dir }}/chunks" when: ('loki' in loki_bins) -- name: create loki configuration directories +- name: Create loki configuration directories file: path: "{{ item }}" state: directory @@ -38,8 +38,7 @@ - "{{ loki_config_dir }}" - block: - - name: download binaries to local folder - become: false + - name: Download binaries get_url: url: "https://github.com/grafana/loki/releases/download/v{{ loki_version }}/{{ item }}-linux-{{ go_arch }}.zip" dest: "/tmp/{{ item }}-{{ loki_version }}-linux-{{ go_arch }}.zip" @@ -49,31 +48,29 @@ retries: 5 delay: 2 loop: "{{ loki_bins }}" - delegate_to: localhost check_mode: false - - name: unpack binaries - become: false + - name: Unpack binaries unarchive: src: "/tmp/{{ item }}-{{ loki_version }}-linux-{{ go_arch }}.zip" dest: "/tmp" - creates: "/tmp/{{ item }}-{{ loki_version }}-linux-{{ go_arch }}" loop: "{{ loki_bins }}" - delegate_to: localhost check_mode: false - - name: propagate official binaries + - name: Copy binaries copy: src: "/tmp/{{ item }}-linux-{{ go_arch }}" dest: "/usr/local/bin/{{ item }}" mode: 0755 owner: root group: root + remote_src: true loop: "{{ loki_bins }}" notify: - restart loki -- name: create systemd service unit + +- name: Create systemd service unit template: src: "{{ item }}.service.j2" dest: "/etc/systemd/system/{{ item }}.service"