This is driving me nuts so I hope someone can help me out here. I’m trying to build a role that fits into Trellis and fills a few of my needs.
What I’m looking to do is run a loop in a .j2 template file that prints some of the URLs of the wordpress_sites
that are set up under that particular environment. But the catch is I only want to print the URLs of sites that for example have ssl enabled or for another example have multisite enabled.
So I have something like 40 sites configured and say 30 have
ssl:
enabled: true
I only want to print out a list of the 30 site URLs in a .j2 template file.
Am I needing to set a variable for that list of sites in the playbook first then use that list to print the URLs in the template file because I can only get the full list of all the URLs to print in the .j2 file, if I try to use any other variables out of wordpress_sites
to limit the loop I get an error about the variables not being defined.