DreamCompute Server unreachable

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
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; 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?

Where did you set your user to dhc-user?

@jasperfrumau Your output indicates it is attempting a connection to your_server_hostname. Have you taken remote servers step 2?

Add your server IP/hostnames to hosts/<environment>


# Documentation: https://roots.io/trellis/docs/ssh-keys/
admin_user: dhc-user

No I did not set up hosts/production. Something I overlooked the last 48 hours somehow. Thanks. Still, now I was connected and ran into this error:

/bin/sh: 1: /usr/bin/python: not found

Python is installed though. Upgraded the whole Ubuntu box with sudo apt-get upgrade and I did have Python installed and consequently upgraded:
python3 --version
Python 3.5.1+
Although Python was installed I got the complaint it was not installed. This is it seems because Ansible needs Python 2. NOT 3. So I ran a: sudo apt-get -y install python-simplejson as suggested at SO here and tried again. All running again now. Thanks again @fullyint and @swalkinshaw


Indeed, ubuntu 16.04 pushed the envelope by shipping only Python3 and also be mindful that it doesn’t ship aptitude by default either. That came back to bite me in the behind when I was upgrading my mariadb servers.

I wrote a playbook that fixes all of that with any new ubuntu 16.04 server, hth.

Other thing is that 16.0.4 has the latest OpenSLL needed for HTTP/2 so I think Trellis will be moving to the latest LTS soon. @austin mentioned that in another thread. Perhaps he can use your playbook and or perhaps you can do a PL @smaffulli .

see also roots/trellis#604 “Change to Ubuntu 16.04 Xenial LTS”

1 Like