Hi,
On Thursday, February 19, 2015 at 2:14:03 AM UTC+1, Brian Coca wrote:
>
> lookup('pipe','dig ' + hostname + '|grep....')
>
> or host/nslookup/dnsip, which ever system utility you have that does the
> same
>
>
>
> --
> Brian Coca
>
i am having somewhat the same problem.
But i dont find any solution to that.
I have to use lookup within a template with jinja2.
address {{ lookup('dig', '({{hosts}}{{domain1}})')
}}
Were hosts and domain1 are lists defined in default/main.yml
and will be used in a for loop inside the jinja2 template.
{% for hosts in hostlist1 %}
define host {
host_name {{hosts}}
alias {{hosts}}{{domain1}}
address {{ lookup('dig', '({{hosts}}{{domain1}})') }}
}
{% endfor %}
Problem: lookup ('dig', does only accept the real string. Not the variables.
So i can't use this in this template.
Any ideas how to overcome this problem?
Many thx in advance!
Timo
--
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/2bf3fa47-f894-46f1-90c9-55ce130ac28f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.