I can ssh into my Dreamcompute server with dhc-user without a password (ssh key) and ip address, but when I run the production Ansible script the server is unreachable:
ansible-playbook server.yml -e env=production -vvv
Using /Users/jasperfrumau/webdesign/sub-all/sub.domain.com/trellis/ansible.cfg as config file
PLAYBOOK: server.yml ***********************************************************
3 plays in server.yml
PLAY [Ensure necessary variables are defined] **********************************
TASK [Ensure environment is defined] *******************************************
task path: /Users/jasperfrumau/webdesign/sub-all/sub.domain.com/trellis/variable-check.yml:8
skipping: [localhost] => {"changed": false, "skip_reason": "Conditional check failed", "skipped": true}
PLAY [Determine Remote User] ***************************************************
TASK [remote-user : Determine whether to connect as root or admin_user] ********
task path: /Users/jasperfrumau/webdesign/sub-all/sub.domain.com/trellis/roles/remote-user/tasks/main.yml:2
ESTABLISH LOCAL CONNECTION FOR USER: jasperfrumau
localhost EXEC /bin/sh -c '( umask 22 && mkdir -p "` echo $HOME/.ansible/tmp/ansible-tmp-1464737323.56-187101897899785 `" && echo "` echo $HOME/.ansible/tmp/ansible-tmp-1464737323.56-187101897899785 `" )'
localhost PUT /var/folders/pn/8mnldklx1pg6f4_0_2bn939r0000gn/T/tmpqC2qnh TO /Users/jasperfrumau/.ansible/tmp/ansible-tmp-1464737323.56-187101897899785/command
localhost EXEC /bin/sh -c 'LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 /usr/bin/python /Users/jasperfrumau/.ansible/tmp/ansible-tmp-1464737323.56-187101897899785/command; rm -rf "/Users/jasperfrumau/.ansible/tmp/ansible-tmp-1464737323.56-187101897899785/" > /dev/null 2>&1'
ok: [your_server_hostname -> localhost] => {"changed": false, "cmd": ["ansible", "your_server_hostname", "-m", "ping", "-u", "root", "--connection=smart", "--timeout=10", "--inventory-file=hosts"], "delta": "0:00:00.610300", "end": "2016-06-01 06:28:44.308236", "failed": false, "failed_when_result": false, "invocation": {"module_args": {"_raw_params": "ansible your_server_hostname -m ping -u root --connection='smart' --timeout='10' --inventory-file='hosts'", "_uses_shell": false, "chdir": null, "creates": null, "executable": null, "removes": null, "warn": true}, "module_name": "command"}, "rc": 3, "start": "2016-06-01 06:28:43.697936", "stderr": "", "stdout": "\u001b[1;31myour_server_hostname | UNREACHABLE! => {\n \"changed\": false, \n \"msg\": \"Failed to connect to the host via ssh.\", \n \"unreachable\": true\n}\u001b[0m", "stdout_lines": ["\u001b[1;31myour_server_hostname | UNREACHABLE! => {", " \"changed\": false, ", " \"msg\": \"Failed to connect to the host via ssh.\", ", " \"unreachable\": true", "}\u001b[0m"], "warnings": []}
TASK [remote-user : Set remote user for each host] *****************************
task path: /Users/jasperfrumau/webdesign/sub-all/sub.domain.com/trellis/roles/remote-user/tasks/main.yml:8
ok: [your_server_hostname] => {"ansible_facts": {"ansible_user": "dhc-user"}, "changed": false, "invocation": {"module_args": {"ansible_user": "dhc-user"}, "module_name": "set_fact"}}
TASK [remote-user : Announce which user was selected] **************************
task path: /Users/jasperfrumau/webdesign/sub-all/sub.domain.com/trellis/roles/remote-user/tasks/main.yml:12
Note: Ansible will attempt connections as user = dhc-user
ok: [your_server_hostname] => {}
PLAY [WordPress Server - Install LEMP Stack with PHP 7.0 and MariaDB MySQL] ****
TASK [setup] *******************************************************************
<your_server_hostname> ESTABLISH SSH CONNECTION FOR USER: dhc-user
<your_server_hostname> SSH: EXEC ssh -C -q -o ForwardAgent=yes -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=dhc-user -o ConnectTimeout=10 -o ControlPath=/Users/jasperfrumau/.ansible/cp/ansible-ssh-%h-%p-%r your_server_hostname '/bin/sh -c '"'"'( umask 22 && mkdir -p "` echo $HOME/.ansible/tmp/ansible-tmp-1464737324.7-145760620664313 `" && echo "` echo $HOME/.ansible/tmp/ansible-tmp-1464737324.7-145760620664313 `" )'"'"''
System info:
Ansible 2.0.2.0; Darwin
Trellis at "Require Ansible 2.0.2 and remove deploy_helper"
---------------------------------------------------
Failed to connect to the host via ssh.
fatal: [your_server_hostname]: UNREACHABLE! => {"changed": false, "unreachable": true}
to retry, use: --limit @server.retry
PLAY RECAP *********************************************************************
localhost : ok=0 changed=0 unreachable=0 failed=0
your_server_hostname : ok=3 changed=0 unreachable=1 failed=0
Any ideas how I can debug this further?