Failure to establish connection when provisioning via ansible-playbook server.yml

thanks for your help, I followed the instructions carefully, I switched to ubuntu 16.04 on DO, added the ssh agent to zsh, solution 1 and 2 didn’t work until I did this in my hosts/staging file:

then this command succeeded:

I didn’t have any ssh config setup and it seems there was no need for any changes in the ansible.cfg file like you suggested:

it seems like I’ve run into more problems though. when attempting to provision the staging server i get this:

TASK [php : Start php7.0-fpm service] ******************************************
System info:
Ansible 2.1.1.0; Linux
Trellis at “Fix #639 - WP 4.6 compatibility: update WP-CLI to 0.24.1”

Job for php7.0-fpm.service failed because the control process exited with
error code. See “systemctl status php7.0-fpm.service” and “journalctl -xe”
for details.

fatal: [lc-dev1.co.uk]: FAILED! => {“changed”: false, “failed”: true}

NO MORE HOSTS LEFT *************************************************************
[WARNING]: Could not create retry file ‘server.retry’. [Errno 2] No such file or directory: ‘’

PLAY RECAP *********************************************************************
lc-dev1.co.uk : ok=46 changed=2 unreachable=0 failed=1
localhost : ok=0 changed=0 unreachable=0 failed=0

after a bit of research i found blob . however my version of trellis already had this set.

when I do [quote=“julianfox, post:9, topic:7418”]
sudo systemctl status php7.0-fpm.service
[/quote] after vagrant ssh as suggested here i get this -

vagrant@lc-blogs-trellis:~$ sudo systemctl status php7.0-fpm.service
● php7.0-fpm.service - The PHP 7.0 FastCGI Process Manager
Loaded: loaded (/lib/systemd/system/php7.0-fpm.service; enabled; vendor preset: enabled)
Active: active (running) since Sat 2016-08-27 01:33:49 UTC; 9h ago
Docs: man:php-fpm7.0(8)
Process: 1774 ExecReload=/bin/kill -USR2 $MAINPID (code=exited, status=0/SUCCESS)
Main PID: 31024 (php-fpm7.0)
Status: “Processes active: 0, idle: 2, Requests: 19, slow: 0, Traffic: 0req/sec”
CGroup: /system.slice/php7.0-fpm.service
├─ 1779 php-fpm: pool wordpress
├─ 1969 php-fpm: pool wordpress
└─31024 php-fpm: master process (/etc/php/7.0/fpm/php-fpm.conf)

Aug 27 01:33:49 lc-blogs-trellis systemd[1]: Starting The PHP 7.0 FastCGI Process Manager…
Aug 27 01:33:49 lc-blogs-trellis systemd[1]: Started The PHP 7.0 FastCGI Process Manager.
Aug 27 01:36:16 lc-blogs-trellis systemd[1]: Reloading The PHP 7.0 FastCGI Process Manager.
Aug 27 01:36:16 lc-blogs-trellis systemd[1]: Reloaded The PHP 7.0 FastCGI Process Manager.

i looked at this forum post

i tried this -

➜ trellis git:(master) ✗ ansible “web:&staging” -m service -a “name=php7.0-fpm state=reloaded” -u web
lc-dev1.co.uk | FAILED! => {
“changed”: false,
“failed”: true,
“msg”: “Failed to start php7.0-fpm.service: Interactive authentication required.\nSee system logs and ‘systemctl status php7.0-fpm.service’ for details.\n”
}
➜ trellis git:(master) ✗ ansible “root:&staging” -m service -a “name=php7.0-fpm state=reloaded” -u web
ERROR! Specified hosts and/or --limit does not match any hosts
➜ trellis git:(master) ✗ ansible “admin:&staging” -m service -a “name=php7.0-fpm state=reloaded” -u web
ERROR! Specified hosts and/or --limit does not match any hosts
➜ trellis git:(master) ✗

when i looked in /etc/sudoers.d/web-services on the staging server as referenced here.

I get this -

root@lc-blogs-stage:~# cat /etc/sudoers.d/web-services

ansible managed: /home/sie/Sites/lc-blogs-trellis/trellis/roles/users/templates/sudoers.d.j2 modified on 2016-08-26 23:31:34 by sie on sie-Lenovo-G510

web ALL=(root) NOPASSWD: /usr/sbin/service php7.0-fpm *
root@lc-blogs-stage:~#

which seems correct.

so this is as far as I have got, i think the ubuntu update to 16.04 may be causing the error