Fix install

This commit is contained in:
sebclem 2021-12-17 12:22:43 +01:00
parent f74de4a831
commit 68ab0aa1ec

View File

@ -27,7 +27,7 @@
- "{{ loki_storage_dir }}/chunks" - "{{ loki_storage_dir }}/chunks"
when: ('loki' in loki_bins) when: ('loki' in loki_bins)
- name: create loki configuration directories - name: Create loki configuration directories
file: file:
path: "{{ item }}" path: "{{ item }}"
state: directory state: directory
@ -38,8 +38,7 @@
- "{{ loki_config_dir }}" - "{{ loki_config_dir }}"
- block: - block:
- name: download binaries to local folder - name: Download binaries
become: false
get_url: get_url:
url: "https://github.com/grafana/loki/releases/download/v{{ loki_version }}/{{ item }}-linux-{{ go_arch }}.zip" 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" dest: "/tmp/{{ item }}-{{ loki_version }}-linux-{{ go_arch }}.zip"
@ -49,31 +48,29 @@
retries: 5 retries: 5
delay: 2 delay: 2
loop: "{{ loki_bins }}" loop: "{{ loki_bins }}"
delegate_to: localhost
check_mode: false check_mode: false
- name: unpack binaries - name: Unpack binaries
become: false
unarchive: unarchive:
src: "/tmp/{{ item }}-{{ loki_version }}-linux-{{ go_arch }}.zip" src: "/tmp/{{ item }}-{{ loki_version }}-linux-{{ go_arch }}.zip"
dest: "/tmp" dest: "/tmp"
creates: "/tmp/{{ item }}-{{ loki_version }}-linux-{{ go_arch }}"
loop: "{{ loki_bins }}" loop: "{{ loki_bins }}"
delegate_to: localhost
check_mode: false check_mode: false
- name: propagate official binaries - name: Copy binaries
copy: copy:
src: "/tmp/{{ item }}-linux-{{ go_arch }}" src: "/tmp/{{ item }}-linux-{{ go_arch }}"
dest: "/usr/local/bin/{{ item }}" dest: "/usr/local/bin/{{ item }}"
mode: 0755 mode: 0755
owner: root owner: root
group: root group: root
remote_src: true
loop: "{{ loki_bins }}" loop: "{{ loki_bins }}"
notify: notify:
- restart loki - restart loki
- name: create systemd service unit
- name: Create systemd service unit
template: template:
src: "{{ item }}.service.j2" src: "{{ item }}.service.j2"
dest: "/etc/systemd/system/{{ item }}.service" dest: "/etc/systemd/system/{{ item }}.service"