role_drone_cli/tasks/installation.yml

33 lines
836 B
YAML
Raw Permalink Normal View History

2022-10-21 15:46:00 +00:00
---
# tasks file for drone_cli
- name: Récupérer le contenu du fichier de version
ansible.builtin.uri:
url: "{{ drone_cli_url }}"
return_content: true
follow_redirects: all
register: releases
- name: Extraire l'URL du paquet
ansible.builtin.set_fact:
browser_download_url: >
{{
releases.json.assets |
selectattr('browser_download_url', 'search', 'linux') |
selectattr('browser_download_url', 'search', drone_cli_architecture) |
map(attribute='browser_download_url')
}}
- name: Extraire le runner
ansible.builtin.unarchive:
src: "{{ browser_download_url | first }}"
dest: /opt/
remote_src: true
list_files: true
mode: u=rwX,g=rX,o=rX
become: true
notify: Installer la commande
- name: Exécuter les handlers
ansible.builtin.meta: flush_handlers