From ba13d40f58d50e53b7aaa7138ccdaabcb16e6a6d Mon Sep 17 00:00:00 2001
From: Arthur BOUDREAULT <arthur@lydra.fr>
Date: Thu, 21 Jul 2022 10:49:01 +0200
Subject: [PATCH] test conditional

---
 roles/ynh_backup/tasks/backup.yml | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/roles/ynh_backup/tasks/backup.yml b/roles/ynh_backup/tasks/backup.yml
index 688d36a..1b1a80a 100644
--- a/roles/ynh_backup/tasks/backup.yml
+++ b/roles/ynh_backup/tasks/backup.yml
@@ -17,6 +17,11 @@
 # along with this program. If not, see <http://www.gnu.org/licenses/>.        #
 #                                                                             #
 #-----------------------------------------------------------------------------#
+- name: Fail if variables are not used correctly
+  ansible.builtin.fail:
+    msg: You need to define variable ynh_backup.apps and / or ynh_backup.system to True
+  when: ynh_backup.apps is false and ynh_backup.system is false
+
 
 - name: Create backup folder if doesn't already exist
   ansible.builtin.file:
-- 
GitLab