How to get the first element of a list from the output of setup module in Ansible?


I received the following data from the setup module:

I want to retrieve the 1st value of ansible_processor and use it in a Jinja2 template.

If I use {{ ansible_processor }}, it’s giving me both values:

But I want only the first one.


To get first item of the list:


Leave a Reply