Hello,
I’ve been trying to reuse some of Trellis’ roles to create a couple new tasks. I’ve spent now a while trying to figure out how Ansible resolved the {{ site }}
. I know that {{ site }}
is a n item from the map in wordpress_sties.yml
. Hoever, the variable is not explicitly assigned value. Take deploy.yml
as an example:
vars:
project: "{{ wordpress_sites[site] }}"
project_root: "{{ www_root }}/{{ site }}"
How is {{ site }}
resolved in {{ project_root }}
?
I created a new deployment playbook - {{ deploy-non-wp.yml }}
and included this:
vars:
project: "{{ non_wordpress_sites[non_wp_site] }}"
project_root: "{{ www_root }}/{{ non_wp_site }}"
along with a new config file non_wordpress_sites.yml
which follows the strcutory of wordpress_sites.yml
.
Still, upon running the playbook, I receive the error message:
‘non_wp_site’ is undefined"
even in this simple task:
---
- name: Create project root directory
file:
path: "{{ project_root }}"
state: directory