You can simply use {{inventory_hostname}} to get the host name of the host
On Mon, 23 Nov, 2020, 5:06 pm blue fox, <[email protected]> wrote:
> Hello,
>
> How to filter ans extract variable in static inventory.
>
> Example:
>
> [webserver]
>
> 10.10.10.10
>
> 20.20.20.20
>
>
> --------------------------
>
> i would to extract each host alone and put him in variable for use in
> playbook.
>
> Thank you
>
> --
> 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/0ba5cde2-d244-499a-9711-57b7749cf1c0n%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/0ba5cde2-d244-499a-9711-57b7749cf1c0n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
--
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/CAKH5aE99P18XCYEQEBFa-qUDvTkO6wQPScH_mYxAEpdpOfvUcQ%40mail.gmail.com.