# ansible.builtin.password generating invalid passwords

**URL:** <https://forum.ansible.com/t/ansible-builtin-password-generating-invalid-passwords/38485>\
**Category:** Ansible Project\
**Created:** [October 2, 2023, 12:26pm UTC](https://forum.ansible.com/t/ansible-builtin-password-generating-invalid-passwords/38485 "2023-10-02T12:26:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kathy\_L](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/kathy_l/32/2652_2.png) [@Kathy\_L](https://forum.ansible.com/u/Kathy_L)\
**Post date:** [October 2, 2023, 12:26pm UTC](https://forum.ansible.com/t/ansible-builtin-password-generating-invalid-passwords/38485/1 "2023-10-02T12:26:24Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![dnmvisser](https://avatars.discourse-cdn.com/v4/letter/d/8e8cbc/32.png) [@dnmvisser](https://forum.ansible.com/u/dnmvisser)\
**Post date:** [October 2, 2023, 1:25pm UTC](https://forum.ansible.com/t/ansible-builtin-password-generating-invalid-passwords/38485/2 "2023-10-02T13:25:08Z")

</div>

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’.

---

<div class="post-metadata">

**Author:** ![utoddl](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/utoddl/32/249_2.png) [@utoddl](https://forum.ansible.com/u/utoddl)\
**Post date:** [October 2, 2023, 1:59pm UTC](https://forum.ansible.com/t/ansible-builtin-password-generating-invalid-passwords/38485/3 "2023-10-02T13:59:14Z")

</div>

Your ‘ascii letters’ should be ‘ascii\_letters’ (with an underscore); maybe that’s throwing things off?

---

<div class="post-metadata">

**Author:** ![Kathy\_L](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/kathy_l/32/2652_2.png) [@Kathy\_L](https://forum.ansible.com/u/Kathy_L)\
**Post date:** [October 2, 2023, 2:14pm UTC](https://forum.ansible.com/t/ansible-builtin-password-generating-invalid-passwords/38485/4 "2023-10-02T14:14:57Z")

</div>

Sorry, that was a typo on my part. The real text was ascii\_letters. Darn fat fingering.
