diff --git a/ansible_github_latest_release b/ansible_github_latest_release new file mode 100644 index 0000000..765b820 --- /dev/null +++ b/ansible_github_latest_release @@ -0,0 +1,12 @@ +- name: Get release_info version + set_fact: + release_info: "{{ lookup('ansible.builtin.url', 'https://api.github.com/repos/Mikescher/better-docker-ps/releases/latest', split_lines=False) | from_json }}" + +- name: Dowload latest version + ansible.builtin.get_url: + url: "https://github.com/Mikescher/better-docker-ps/releases/download/{{ release_info['tag_name'] }}/dops_linux-amd64-static" + dest: "/usr/local/bin/dops" + when: release_info + become: true + become_user: root + become_method: sudo