Hi - I'm new to Ansible and trying to create a role that contains a file,
the contents of which are passed to a second role.
Example Structure:
RoleA
files
- foo.txt
meta
- main.yml
The contents of main.yml are:
---
dependencies:
- {role: RoleB, data: "{{ lookup('file', 'foo.txt') }}"}
Both RoleA and RoleB are located in /etc/ansible/roles
The playbook has a single site.yml that contains:
---
- hosts: all
roles:
- role: RoleA
What I expected to happen is that the tasks defined in Role B would be
executed, and the variable "data" would resolve to the value contained in
foo.txt.
What I'm getting is:
ERROR: Failed to template {{ lookup('file', 'foo.txt') }}: could not locate
file in lookup: foo.txt
Any help/ideas on this would be greatly appreciated.
--
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/ca2531ee-b337-4d1d-9bb7-d5483107df05%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.