grafana-ansible-collection icon indicating copy to clipboard operation
grafana-ansible-collection copied to clipboard

alloy: Restart the service when version is changed

Open f9n opened this issue 1 year ago • 1 comments

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

f9n avatar Jul 01 '24 09:07 f9n

Yeah, Ideally Alloy should be restarted when we have a version change.

Lemme know if you wanna fix this in a PR

ishanjainn avatar Jul 12 '24 13:07 ishanjainn

This is no longer relevant, as a restart is now implemented when Alloy is updated to a newer version.

voidquark avatar Oct 21 '24 15:10 voidquark