To get first item of the list:
- debug:
msg: "First item: {{ ansible_processor[0] }}"
Or:
- debug:
msg: "First item: {{ ansible_processor | first }}"
More Related Contents:
- How can I use Ansible nested variable?
- How can I make Ansible interpret a variable inside a variable?
- ansible command to list all known hosts
- How to use Ansible’s with_item with a variable?
- How to copy files between two nodes using ansible
- Using Ansible set_fact to create a dictionary from register results
- Ansible fails with /bin/sh: 1: /usr/bin/python: not found
- Only check whether a line present in a file (ansible)
- How to loop over this dictionary in Ansible?
- In Ansible, how to combine variables from separate files into one array?
- Not possible to source .bashrc with Ansible
- Specify sudo password for Ansible
- How do I register a variable and persist it between plays targeted on different nodes?
- Why does Ansible show “ERROR! no action detected in task” error?
- How to switch a user per task or set of tasks?
- How can a user with SSH keys authentication have sudo powers in Ansible? [duplicate]
- Ansible: How to iterate over a role with an array?
- Ansible: how to construct a variable from another variable and then fetch it’s value
- How to join a list of strings in Ansible?
- How to set environmental variables using Ansible
- Ansible shows error: “One or more undefined variables: ‘item’ is undefined” when using ‘with_items’
- How to set host_key_checking=false in ansible inventory file?
- Ansible with_subelements
- Ansible remote_user vs ansible_user
- Ansible “when variable == true” not behaving as expected
- Ansible with a bastion host / jump box? [duplicate]
- How can I use a condition to set a variable value in Ansible?
- How can I copy files between two managed nodes using Ansible?
- Ansible – Save registered variable to file
- Accessing inventory host variable in Ansible playbook