I don't think you can filter host vars based on where they're set

On Thu, 11 Jun 2020 at 07:09, utkarsh srivastava <
[email protected]> wrote:

> Hi
>
> I want to list all variable and it's value defined in hosts file
> corresponding to a host
> for example:
>
> [hostgroup1]
> host1     variable1=value1   variable2=value2  variable3=value3
>
> so i want to list all variables defined
> like
> variable1: value1
> variable2: value2
> variable3: value3
>
> I am using
>
> - debug:
>            msg: "{{ hostvars[inventory_hostname] }}"
>
> but in this case, On console output i am getting predefined variables as
> well related to that host along with manual defined variables
>
>
> Any help would be appreciated
>
> Thanks in advance.
>
> --
> 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/3ba35e6c-1477-44e9-b9ba-d7e5a8fc32e1o%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/3ba35e6c-1477-44e9-b9ba-d7e5a8fc32e1o%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
-- 
Sent from a mobile device - please excuse the brevity, spelling and
punctuation.

-- 
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/CAL8fbwNt0Sfn6wr0guy5_mhQTZ%2BOsXBoLqmxGOtDgDQLHXvGnQ%40mail.gmail.com.

Reply via email to