Ansible_Facts
Facts Ansible implements fact collecting through the a module called the setup module. It collects detailed information (called facts) from managed nodes. It collects detailed information (called facts) from managed nodes. By default, Ansible automatically runs setup at the start of every play. $ ansible ubuntu -m setup - name : Gather facts manually hosts : all tasks : - name : Run setup module ansible.builtin.setup : - debug : msg : "Host {{ ansible_hostname }} has {{ ansible_memtotal_mb }} MB RAM" Filtering Facts Collect only specific facts - name : Get only network-related facts ansible.builtin.setup : filter : ansible_default_ipv4 - name : Get only facts that start with 'ansible_processor' ansible.builtin.setup : filter : 'ansible_processor*' - name : Get only facts that start with 'ansible_processor' and 'ansible_mem' ansible.builtin.setup : filter : 'ansible_processor*' , ...