Assert in ansible playbook

Hi All,

I’m creating a playbook which validates user input.

Input string would be something like : “cluster-test-1”

I want to assert that input has only lowercase, digits or hypen. (No other special character is allowed)

Please suggest how I can achieve this, so that the playbook exits if input validation is failed.

Thanks,
Shivani

How is the user input being supplied to the playbook?

I would do something like this -