I have an ansible task which creates a new user on ubuntu 12.04;
- name: Add deployment user action: user name=deployer password=mypassword
This is the easy way:
--- - name: Create user user: name=user shell=/bin/bash home=/srv/user groups=admin,sudo generate_ssh_key=yes ssh_key_bits=2048 - name: Set password to user shell: echo user:plain_text_password | sudo chpasswd no_log: True