I have an ansible variable which is a list of dicts:
userdata:
- { first: Mike, last: Smith, username: msmith}
- { first: Jane, last: Largo, username: jlargo}
- { first: Evan, last: Jones, username: ejones}
I would like to add a field to each entry, password that has a randomly generated 20 character alpha-numeric password assigned to each entry so I can use it to as applicable during the playbook for the various actions that need to sync that password to. I tried doing a block:, but learned that you can't do that with_items. I also couldn't find a way to use with_items and save back to that item's dictionary. The password lookup plugin looks promissing to get a random password without having to save it to a file (/dev/null), but I can't seem to get it in each element of the list.
In the end, I would like a structure like this:
userdata:
- { first: Mike, last: Smith, username: msmith, password: FdUChpPtfonoPexMZmt0}
- { first: Jane, last: Largo, username: jlargo, password: QR13sN7CP00LbdXZ0gON}
- { first: Evan, last: Jones, username: ejones, password: OCQSmqCbO8239jHpQiRm}