ansible-role-ntfy-alertmanager/tasks/main.yml

26 lines
896 B
YAML

---
- name: Clone git repository
ansible.builtin.git:
repo: https://git.xenrox.net/~xenrox/ntfy-alertmanager
dest: "{{ ansible_env.HOME }}/src/ntfy-alertmanager"
version: "{{ ntfy_alertmanager_version }}"
register: git_repository
- name: Create the required version.txt file for building ntfy-alertmanager
ansible.builtin.shell:
chdir: "{{ ansible_env.HOME }}/src/ntfy-alertmanager"
cmd: git describe --long > version.txt
when: git_repository.changed
- name: Build ntfy-alertmanager
ansible.builtin.command:
chdir: "{{ ansible_env.HOME }}/src/ntfy-alertmanager"
cmd: "{{ ansible_local.golang.general.home }}/bin/go build ."
when: git_repository.changed
- name: Install ntfy-alertmanager binary
ansible.builtin.copy:
remote_src: true
src: "{{ ansible_env.HOME }}/src/ntfy-alertmanager/ntfy-alertmanager"
dest: /usr/local/bin/
become: true