Ansibleでサーバー情報を取得する
code:yaml
---
- name: Gather specific server information
hosts: webservers
tasks:
- name: Get network, OS, and hardware related facts
ansible.builtin.setup:
filter:
- ansible_all_ipv4_addresses
- ansible_distribution
- ansible_distribution_version
- ansible_architecture
- ansible_memtotal_mb
- name: Display gathered facts
ansible.builtin.debug:
var: ansible_facts
メモ