role_drone_runner_exec/tasks/installation.yml

47 lines
1.2 KiB
YAML

---
# tasks file for drone_runner_exec
- name: Installer les prérequis
ansible.builtin.package:
name: "{{ item }}"
become: true
loop: "{{ drone_runner_exec_prerequisites }}"
- name: Créer le dossier dédié
ansible.builtin.file:
path: /opt/drone-runner-exec
state: directory
owner: root
group: root
mode: u=rwX,g=rX,o=rX
become: true
- name: Récupérer le contenu du fichier de version
ansible.builtin.uri:
url: "{{ drone_runner_exec_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_runner_exec_architecture) |
map(attribute='browser_download_url')
}}
- name: Extraire le runner
ansible.builtin.unarchive:
src: "{{ browser_download_url | first }}"
dest: /opt/drone-runner-exec
remote_src: true
list_files: true
owner: root
group: root
mode: u=rwX,g=rX,o=rX
become: true
notify: Redémarrer drone-runner-exec.service