I am creating admin user account by prompting for user input through Ansible. This admin account
vars_prompt:
- name: "Username"
prompt: "Enter the administrator username"
private: no
- name: "Password"
prompt: "Enter the administrator password.Password must contain at least 8 total printable ASCII character(s)."
private: yes
- name: "Confirm_Password"
prompt: Confirm Password
private: yes
I want to check if the password length is greater or equal to 8 and it contains only ASCII chars.
I tried something like this:
- name : Password matches the splunk condition
assert:
that:
- Password | length >= 8 and chars=ascii_letters
success_msg: "Passed."
fail_msg: "New password is too short!"
quiet: true
tags: password_check
But it isn't working.