I have a playbook in which part of the variables is obtained by typing from the keyboard, in particular, I need to check for the maximum number of characters for the hostnamevar variable (no more than 15 characters).
I tried this design:
vars_prompt: - name: "hostnamevar" prompt: "Enter hostname (less than 15 characters)" failed_when: hostnamevar | length > 15 private: no I tried this:
vars_prompt: - name: "hostnamevar" prompt: "Enter hostname (less than 15 characters)" private: no pre_tasks: - assert: that: - 'hostnamevar|length > 15' msg: "'hostnamevar' should be less or equal 15 symbols" I tried to leave it as tasks instead of pre_tasks. Absolutely no difference and no input restrictions. Dear, advise how to still implement such a test?