grafana-ansible-collection
grafana-ansible-collection copied to clipboard
alloy: Restart the service when version is changed
When we change the version (1.0.0 -> 1.2.0), role does not restart the alloy service. Is this normal? Or can we support restarting when version changes?
# roles/alloy/tasks/install.yml
...
- name: Download alloy binary
ansible.builtin.get_url:
url: "{{ binary_url }}"
dest: "/tmp/alloy-{{ version }}.zip"
mode: '0755'
become: true
- name: Extract alloy binary
ansible.builtin.unarchive:
src: "/tmp/alloy-{{ version }}.zip"
dest: "/tmp"
remote_src: yes
become: true
- name: Copy installed binary to installation dir
ansible.builtin.copy:
src: "/tmp/alloy-linux-{{ arch }}"
dest: "{{ installation_dir }}/alloy-linux-{{ arch }}"
mode: '0755'
remote_src: yes
become: true
notify: Restart alloy
If it is convenient for you, we can create a pull request for the above changes. cc: @emre-23 @acciorg
Yeah, Ideally Alloy should be restarted when we have a version change.
Lemme know if you wanna fix this in a PR
This is no longer relevant, as a restart is now implemented when Alloy is updated to a newer version.