Hey guys, I'm trying to use a registered variable in **with_items** list,
but can find a way to do it.
Here is what I'm doing:
```yaml
- *name*: acquire Django root path
*shell*: pip show django | grep 'Location' | sed 's/Location:\ //g'
*register*: django_root
- *name*: customize Graphite Apache configuration
*lineinfile*: dest={{ apache_vhost_folder }}/graphite.conf regexp={{
item.default }} line={{ item.custom }} state=present
*with_items*:
- { *default*: 'WSGISocketPrefix run/wsgi', *custom*:
'WSGISocketPrefix /var/run/{{ apache_service_name }}/wsgi' }
- { *default*: '\@DJANGO_ROOT\@', *custom*: "{{ *django_root*.stdout_lines
}}" } # trying to use registered variable *django_root*, but failed
```
First, I get the Django root path, and register it as a variable named `
*django_root*`;
Then, I'd like to use it in the second item of `*with_items*` list, but
failed.
Is there a good way to achieve this goal? Thanks!
Tim
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/8602714f-d971-4f60-971c-4933a3a9e7a9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.