Web server cannot be changed to Nginx

If you change the default Web server from Apache to Nginx in ansible/playbook.yml like so:

-    aegir_http_service_type: apache
+    aegir_http_service_type: nginx

...vagrant up (or vagrant provision) eventually hits:

RUNNING HANDLER [geerlingguy.php : restart webserver] **************************
[...]
fatal: [default]: FAILED! => {"changed": false, "msg": "Could not find the requested service apache2: host"}
[...]
PLAY RECAP *********************************************************************
default                    : ok=115  changed=46   unreachable=0    failed=1    skipped=80   rescued=0    ignored=0   

Ansible failed to complete successfully. Any error output should be
visible above. Please fix these errors and try again.

Workaround

Just restart the Web server manually.

  1. vagrant ssh
  2. sudo service nginx restart

And then continue with the set-up:

  1. sudo -sHu aegir
  2. drush @hm uli
Edited by Colan Schwartz