I'm trying to add users to my servers using Ansible. Each user have a different encrypted password.
I have something like that:
vars:
users:
- myuser1
- myuser2
password: encryptedpasswordhere
tasks:
- name: Creating users
user: name={{ item }} password={{ password }} groups=sudo,adm shell=/bin/bash
with_items: users
This work great, but all users have the same password.
I'm looking to make an associative array. In PHP I would do that:
$users = array('user'=>'myuser1', 'password'=>'encryptedpass1',
'user'=>'myuser2', 'password'=>'encryptedpass2',
);
There is a way to do that in an Ansible playbook?
http://docs.ansible.com/playbooks_loops.html#looping-over-hashes
and