I am working on a gitlab-ci project.
I have a variable A that I retrieve from a form.
I have to set another variable B in my playbook.
If A matches a certain regex, B should be ' -p A' else B should be an empty string ''.
This should be written in an Ansible file.
I have tried
- set_fact:
B="{{ ' -p ' + A}}"
when: A is regex("^\\d{1,8}$")
but it didn't work.
Can someone help me?