From a6070477ad4da0c1bcc6991e6306488de1f43864 Mon Sep 17 00:00:00 2001 From: "pulsar89.5" Date: Fri, 16 Feb 2024 10:50:24 +0100 Subject: [PATCH] fix: Move containers tasks --- tasks/container.yml | 22 ++++++++++++++++++++++ tasks/main.yml | 23 +++-------------------- 2 files changed, 25 insertions(+), 20 deletions(-) create mode 100644 tasks/container.yml diff --git a/tasks/container.yml b/tasks/container.yml new file mode 100644 index 0000000..084418f --- /dev/null +++ b/tasks/container.yml @@ -0,0 +1,22 @@ +--- +# tasks file for wireguard + +- name: Tâches de gestion du module du noyau + block: + - name: Charger le module du noyau + community.general.modprobe: + name: wireguard + state: present + rescue: + - name: Installer le module du noyau sur l'hôte + ansible.builtin.apt: + update_cache: true + name: wireguard-dkms + become: true + delegate_to: "{{ wireguard_module_host }}" + +- name: Installer l'outil de configuration + ansible.builtin.apt: + update_cache: true + name: wireguard-tools + become: true diff --git a/tasks/main.yml b/tasks/main.yml index 6ba1629..0a690fb 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -8,27 +8,10 @@ when: wireguard_module_host | length == 0 become: true -- name: Tâches de gestion du module du noyau - block: - - name: Charger le module du noyau - community.general.modprobe: - name: wireguard - state: present - rescue: - - name: Installer le module du noyau sur l'hôte - ansible.builtin.apt: - update_cache: true - name: wireguard-dkms +- name: Importer les tâches spécifique aux conteneurs + ansible.builtin.import_tasks: + file: container.yml when: wireguard_module_host | length > 0 - become: true - delegate_to: "{{ wireguard_module_host }}" - -- name: Installer l'outil de configuration - ansible.builtin.apt: - update_cache: true - name: wireguard-tools - when: wireguard_module_host | length > 0 - become: true - name: Déployer la configuration des interfaces ansible.builtin.template: