Easy install not working on fresh Ubuntu 16.04

Lets do this step by step with easy install script.
Spin up a Ubuntu Server 16.04 LTS (HVM) on Amazon Web Services. Instance type t2 micro.1 CPU, 1GB RAM, 8GB storage.
~$ sudo apt-get update
~$ sudo apt-get upgrade
~$ sudo apt-get install python-minimal
~$ wget https://raw.githubusercontent.com/frappe/bench/master/playbooks/install.py
~$ python install.py --develop --user frappe --verbose

everything goes well until

TASK [Create user] *************************************************************
task path: /tmp/.bench/playbooks/develop/create_user.yml:4
ESTABLISH LOCAL CONNECTION FOR USER: ubuntu
127.0.0.1 EXEC /bin/sh -c ‘( umask 22 && mkdir -p “echo $HOME/.ansible/tmp/ansible-tmp-1481105485.58-103510652255074” && echo “echo $HOME/.ansible/tmp/ansible-tmp-1481105485.58-103510652255074” )’
127.0.0.1 PUT /tmp/tmptZcY8d TO /home/ubuntu/.ansible/tmp/ansible-tmp-1481105485.58-103510652255074/user
127.0.0.1 EXEC /bin/sh -c ‘LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 /usr/bin/python /home/ubuntu/.ansible/tmp/ansible-tmp-1481105485.58-103510652255074/user; rm -rf “/home/ubuntu/.ansible/tmp/ansible-tmp-1481105485.58-103510652255074/” > /dev/null 2>&1’
fatal: [localhost]: FAILED! => {“changed”: false, “failed”: true, “invocation”: {“module_args”: {“append”: false, “comment”: null, “createhome”: true, “expires”: null, “force”: false, “generate_ssh_key”: true, “group”: null, “groups”: null, “home”: null, “login_class”: null, “move_home”: false, “name”: “frappe”, “non_unique”: false, “password”: null, “remove”: false, “shell”: null, “skeleton”: null, “ssh_key_bits”: “2048”, “ssh_key_comment”: “ansible-generated on ip-172-31-18-89”, “ssh_key_file”: null, “ssh_key_passphrase”: null, “ssh_key_type”: “rsa”, “state”: “present”, “system”: false, “uid”: null, “update_password”: “always”}, “module_name”: “user”}, “msg”: “useradd: Permission denied.\nuseradd: cannot lock /etc/passwd; try again later.\n”, “name”: “frappe”, “rc”: 1}

NO MORE HOSTS LEFT *************************************************************
to retry, use: --limit @develop/create_user.retry

PLAY RECAP *********************************************************************
localhost : ok=1 changed=0 unreachable=0 failed=1

Traceback (most recent call last):
File “install.py”, line 351, in
install_bench(args)
File “install.py”, line 98, in install_bench
run_playbook(‘develop/create_user.yml’, extra_vars=extra_vars)
File “install.py”, line 301, in run_playbook
success = subprocess.check_call(args, cwd=os.path.join(cwd, ‘playbooks’))
File “/usr/lib/python2.7/subprocess.py”, line 541, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command ‘[‘ansible-playbook’, ‘-c’, ‘local’, ‘develop/create_user.yml’, ‘-e’, ‘@/tmp/extra_vars.json’, ‘-vvvv’]’ returned non-zero exit status 2

Excuse me. I did not read properly. Need to be logged in as root before running
python install.py --develop --user frappe --verbose

@s_list so it worked for you now?

I had the same error, and this helped!