Same error with --production and exact same script
TASK [Create new site] **********************************************************************************************************************************
fatal: [localhost]: FAILED! => {"changed": true, "cmd": ["bench", "new-site", "site1.local", "--admin-password", "frappe", "--mariadb-root-password", "frappe"], "delta": "0:00:03.217272", "end": "2018-01-19 22:26:55.814059", "failed": true, "rc": 1, "start": "2018-01-19 22:26:52.596787", "stderr": "ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)", "stderr_lines": ["ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)"], "stdout": "Database not installed, this can due to lack of permission, or that the database name exists.\nCheck your mysql root password, or use --force to reinstall", "stdout_lines": ["Database not installed, this can due to lack of permission, or that the database name exists.", "Check your mysql root password, or use --force to reinstall"]}
to retry, use: --limit @/tmp/.bench/playbooks/production/install.retry
PLAY RECAP **********************************************************************************************************************************************
localhost : ok=69 changed=41 unreachable=0 failed=1
Traceback (most recent call last):
File "install.py", line 388, in <module>
install_bench(args)
File "install.py", line 114, in install_bench
run_playbook('production/install.yml', sudo=True, extra_vars=extra_vars)
File "install.py", line 326, 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', 'production/install.yml', '-e', '@/tmp/extra_vars.json', '--become', '--become-user=frappe']' returned non-zero exit status 2