fix: Move containers tasks

This commit is contained in:
pulsar89.5 2024-02-16 10:50:24 +01:00
parent cf129a2a44
commit a6070477ad
2 changed files with 25 additions and 20 deletions

22
tasks/container.yml Normal file
View File

@ -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

View File

@ -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: