From d8933c21248a4a69905e7a037975acb72e9ca6ea Mon Sep 17 00:00:00 2001 From: "pulsar89.5" Date: Sun, 30 Mar 2025 06:28:49 +0200 Subject: [PATCH] feat: Add compatibility with CoreOS --- handlers/main.yml | 8 -------- meta/main.yml | 3 +++ tasks/configuration.yml | 6 +++--- tasks/installation.yml | 12 ++++-------- 4 files changed, 10 insertions(+), 19 deletions(-) delete mode 100644 handlers/main.yml diff --git a/handlers/main.yml b/handlers/main.yml deleted file mode 100644 index cf5f3ed..0000000 --- a/handlers/main.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -# handlers file for drone_cli - -- name: Installer la commande - ansible.builtin.command: - chdir: /opt - cmd: install -t /usr/local/bin drone - become: true diff --git a/meta/main.yml b/meta/main.yml index c58bebf..de0cbd6 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -11,5 +11,8 @@ galaxy_info: - name: Debian versions: - all + - name: CoreOS + versions: + - 41 dependencies: [] diff --git a/tasks/configuration.yml b/tasks/configuration.yml index 79adc66..a89ad02 100644 --- a/tasks/configuration.yml +++ b/tasks/configuration.yml @@ -1,7 +1,7 @@ --- # tasks file for drone_cli -- name: Récupérer les informations +- name: Get informations ansible.builtin.command: cmd: drone {{ item.type }} info {{ item.target }} {{ item.name }} environment: @@ -11,14 +11,14 @@ changed_when: info.rc != 0 diff: false -- name: Déterminer qu'il faut mettre à jour +- name: Set update if needed ansible.builtin.set_fact: cmd_action: update when: - info.rc == 0 - item.type in cmd_updatable -- name: Exécuter les commandes +- name: Run commands ansible.builtin.command: cmd: drone {{ item.type }} {{ cmd_action }} {{ item.target }} {{ item.name }} {{ item.data }} environment: diff --git a/tasks/installation.yml b/tasks/installation.yml index ade5d7d..d8f766c 100644 --- a/tasks/installation.yml +++ b/tasks/installation.yml @@ -1,14 +1,14 @@ --- # tasks file for drone_cli -- name: Récupérer le contenu du fichier de version +- name: Get version file ansible.builtin.uri: url: "{{ drone_cli_url }}" return_content: true follow_redirects: all register: releases -- name: Extraire l'URL du paquet +- name: Extract URL ansible.builtin.set_fact: browser_download_url: > {{ @@ -18,15 +18,11 @@ map(attribute='browser_download_url') }} -- name: Extraire le runner +- name: Install drone ansible.builtin.unarchive: src: "{{ browser_download_url | first }}" - dest: /opt/ + dest: /usr/local/bin/ 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