group_vars
host_vars
misc-plays
roles
common
mariadb
munin
nginx
php-fpm
defaults
handlers
tasks
templates
vars
.gitignore
LICENSE
Pipfile
Pipfile.lock
README.md
ansible.cfg
nomads.yml
site.yml
web.yml
First, we cannot do a global check for has_wordpress or needs_php, as those are defined per nginx vhost. Second, I realized that this was only working in the past because vhosts that had WordPress or needed PHP were listed first in the nginx_vhosts dict. This changes the logic to first check if any vhosts have WordPress or need PHP, then sets a fact that we can use to decide whether to run php-fpm tasks or not.