On Wed, Aug 21, 2019, at 2:35 PM, 'Mark Tovey' via Ansible Project wrote:
>
> I hate having to constantly go here to solve issues like this,
> especially when the issues I keep presenting are all so similar, but
> eventually I have to just give up trying to solve this on my own and
> ask.
>
> I want to define a structure in a vars file that looks like the following:
>
> > myos: {
> > configdir: "/path/to/directory",
> > configfile: "filename"
> > }
> > my_configdir: "{{ansible_facts.distribution}}.configdir"
my_configdir: "{{ (lookup('vars' ansible_facts.distribution)).configdir }}"
And so on...
> > my_configfile: "{{ansible_facts.configfile}}.configfile"
>
>
> I want to do something similar to the following:
>
> > stat:
> > path: "{{my_configdir}}/{{my_configfile}}"
> > register: result
> Unfortunately, path is being resolved to
> "myos.configdir/myos.configfile", not the expected
> "/path/to/directory/filename". I have tried using various methods of
> concatenating variables together, including trying the 'vars' lookup
> plugin, but I have not been able to work this out after two days of
> trying. So, here I am, back at the well, looking for another answer.
> Does anyone have any advice?
>
>
V/r,
James Cassell
--
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 view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/ead8c9e9-b513-4dce-a8d9-af683500a4b4%40www.fastmail.com.