backup-and-restore: fix check on 'mode' variable

Typical failure:

```
fatal: [localhost]: FAILED! =>
  msg: |-
    The conditional check 'mode not in ['backup', 'restore']' failed. The error was: error while evaluating conditional (mode not in ['backup', 'restore']): 'mode' is undefined
```

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=2051640

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit 848dd03fa6)
pull/7222/head
Guillaume Abrioux 2022-06-29 08:40:13 +02:00
parent 4156fd569f
commit 9965bf6cd6
1 changed files with 1 additions and 1 deletions

View File

@ -42,7 +42,7 @@
"you must pass the mode: -e mode=<backup|restore>"
when:
- mode is not defined
- mode not in ['backup', 'restore']
or mode not in ['backup', 'restore']
- name: gather facts on source node
setup: