Use the debug module and print out the value of httpd_port when running
over some or all of your servers. You can do this with an ad-hoc command
like:
ansible all -m debug -a 'msg="Port is {{ httpd_port }}"'
On Tuesday, May 5, 2015 at 8:41:08 AM UTC-4, Ivan Kurnosov wrote:
>
> Hi,
>
> is it possible to retrieve variables defined per host with all group_vars
> and host_vars definitions applied?
>
> The case:
>
> let's say we have a task to configure an haproxy instance.
>
> In its config file template we iterate over servers in the `webserver`
> group and need to retrieve the `httpd_port` variable that might be defined
> in either some of `group_vars` or `host_vars`.
>
> So for a particular server it might be a specific setting in
> `host_vars/hostname` or a generic one from `group_vars/webserver`
>
> How would you resolve it?
>
--
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/e12e1f7e-0e90-4a06-8f7a-8ff4e53402b1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.