I’ve updated my trellis clone to the latest version, but now get this error ‘site_env’ is undefined when I run ansible-playbook -vvvv server.yml -e env=staging.
TASK [wordpress-setup : Create database of sites] ******************************
task path: /home/ivan/dev/moje/fapps/trellis/roles/wordpress-setup/tasks/database.yml:2
System info:
Ansible 2.0.1.0; Linux
Trellis 0.9.7: April 10th, 2016
‘site_env’ is undefined
fatal: [46.101.240.80]: FAILED! => {“failed”: true}
to retry, use: --limit @server.retry
I’m getting this as well while trying to run vagrant provision to re-provision my local env.
TASK [wordpress-setup : Create database of sites] ****************************** fatal: [default]: FAILED! => {"failed": true, "msg": "The conditional check 'site_uses_local_db and item.value.db_create | default(True)' failed. The error was: error while evaluating conditional (site_uses_local_db and item.value.db_create | default(True)): 'site_env' is undefined\n\nThe error appears to have been in '***/trellis/roles/wordpress-setup/tasks/database.yml': line 2, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n---\n- name: Create database of sites\n ^ here\n"} to retry, use: --limit @***/trellis/dev.retry
@swalkinshaw I’m getting the same /similar error.in trellis as at 28/2/17 You link to a file in /group_vars/all but it doesnt say in the docs to edit that file with that line. Can this go in /staging/main.yml?
TASK [wordpress-setup : Create database of sites] ******************************
System info:
Ansible 2.2.1.0; Darwin
Trellis at "Allow for per-project packagist.com authentication"
The conditional check 'site_uses_local_db and item.value.db_create |
default(True)' failed. The error was: error while evaluating conditional
(site_uses_local_db and item.value.db_create | default(True)): {{
site_env.db_host == 'localhost' }}: {{ wordpress_env_defaults |
combine(item.value.env | default({}), vault_wordpress_sites[item.key].env)
}}: 'unicode object' has no attribute u'staging.sliponjohn.band'
The error appears to have been in
'/Users/lukemackenzie/Sites/sliponjohn.band/trellis/roles/wordpress-
setup/tasks/database.yml': line 2, column 3, but may
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
---
- name: Create database of sites
^ here
fatal: [staging.sliponjohn.band]: FAILED! => {"failed": true}
Or do I need to have these defined in staging/wordpress_sites.yml?: