ansible.builtin.password generating invalid passwords

42 views
Skip to first unread message

Kathy L

unread,
Oct 2, 2023, 8:26:24 AM10/2/23
to Ansible Project
I am using ansible core version 2.14.3.  When I generate a username in the following fashion:

   set_fact:
     passwd: "{{ lookup('ansible.builtin.password', '/dev/null', chars=['ascii letters', 'digits'], length=range(10,15) | random ) }}"

I get usernames with colons in the middle of the password.  This has worked for over 6 months and we are just now seeing this error.  Can anyone see what I am doing wrong?

Dick Visser

unread,
Oct 2, 2023, 9:25:41 AM10/2/23
to ansible...@googlegroups.com
No, but things don't just change by themselves. If your invocation/task has not changed, the question becomes: what else has changed?

Something different, you specify 'ascii letters', but when i try that, it yields passwords with spaces in them. You might want to use 'ascii_letters'.

Todd Lewis

unread,
Oct 2, 2023, 9:59:28 AM10/2/23
to ansible...@googlegroups.com, uto...@gmail.com
Your 'ascii letters' should be 'ascii_letters' (with an underscore); maybe that's throwing things off?

Kathy Lyons

unread,
Oct 2, 2023, 10:15:26 AM10/2/23
to ansible...@googlegroups.com, uto...@gmail.com
Sorry, that was a typo on my part.  The real text was ascii_letters. Darn fat fingering.

--
You received this message because you are subscribed to a topic in the Google Groups "Ansible Project" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ansible-project/Ap11UzsDz5w/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/7cf2a612-589c-02d0-bd5d-7e379c0e7943%40gmail.com.
Reply all
Reply to author
Forward
0 new messages