33 lines
836 B
YAML
33 lines
836 B
YAML
|
---
|
||
|
# 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
|