🔨 Clean temp files
This commit is contained in:
parent
64d92cb1df
commit
b93a4dc2f8
@ -57,6 +57,7 @@
|
|||||||
dest: "/tmp"
|
dest: "/tmp"
|
||||||
loop: "{{ loki_bins }}"
|
loop: "{{ loki_bins }}"
|
||||||
check_mode: false
|
check_mode: false
|
||||||
|
when: _download_archive is changed
|
||||||
|
|
||||||
- name: Copy binaries
|
- name: Copy binaries
|
||||||
copy:
|
copy:
|
||||||
@ -69,6 +70,14 @@
|
|||||||
loop: "{{ loki_bins }}"
|
loop: "{{ loki_bins }}"
|
||||||
notify:
|
notify:
|
||||||
- restart loki
|
- restart loki
|
||||||
|
when: _download_archive is changed
|
||||||
|
|
||||||
|
- name: Clean binaries
|
||||||
|
file:
|
||||||
|
path: "/tmp/{{ item }}-linux-{{ go_arch }}"
|
||||||
|
state: absent
|
||||||
|
loop: "{{ loki_bins }}"
|
||||||
|
when: _download_archive is changed
|
||||||
|
|
||||||
|
|
||||||
- name: Create systemd service unit
|
- name: Create systemd service unit
|
||||||
@ -81,3 +90,18 @@
|
|||||||
notify: "restart {{ item }}"
|
notify: "restart {{ item }}"
|
||||||
loop: "{{ loki_bins }}"
|
loop: "{{ loki_bins }}"
|
||||||
when: item == 'loki' or item == 'promtail'
|
when: item == 'loki' or item == 'promtail'
|
||||||
|
|
||||||
|
|
||||||
|
- name: Find temps files to del
|
||||||
|
find:
|
||||||
|
paths: /tmp
|
||||||
|
file_type: file
|
||||||
|
patterns: 'loki-*-linux-{{ go_arch }}.zip,promtail-*-linux-{{ go_arch }}.zip'
|
||||||
|
excludes: 'loki-{{ loki_version }}-linux-{{ go_arch }}.zip,promtail-{{ loki_version }}-linux-{{ go_arch }}.zip'
|
||||||
|
register: to_del
|
||||||
|
|
||||||
|
- name: Clean temp files
|
||||||
|
file:
|
||||||
|
path: "{{ item.path }}"
|
||||||
|
state: absent
|
||||||
|
loop: "{{ to_del.files }}"
|
||||||
|
Loading…
Reference in New Issue
Block a user