cleanup, add version support

This commit is contained in:
2026-01-15 23:33:48 -07:00
parent 89232a5c08
commit 7249ec7a5e

View File

@@ -8,12 +8,31 @@
- name: Unarchive prometheus binary - name: Unarchive prometheus binary
unarchive: unarchive:
src: "{{ download_result.dest }}" src: "{{ download_result.dest }}"
dest: /usr/local/bin/ dest: /tmp
remote_src: true # Indicates the source file is on the remote host remote_src: true # Indicates the source file is on the remote host
owner: root owner: root
group: root group: root
mode: 0755 mode: 0755
- name: Copy prometheus binary to /usr/local/bin
copy:
src: "/tmp/prometheus-{{ prometheus_version }}.linux-amd64/prometheus"
dest: "/usr/local/bin/prometheus-{{ prometheus_version }}"
owner: root
group: root
mode: '0755'
remote_src: yes
- name: Create prometheus binary symlink
file:
src: "/usr/local/bin/prometheus-{{ prometheus_version }}"
dest: "/usr/local/bin/prometheus"
state: link
owner: root
group: root
mode: '0755' # Permissions for the target file
force: yes
- name: Create a prometheus group - name: Create a prometheus group
group: group:
name: prometheus name: prometheus