--- # Playbook: Gather System Information # Description: Collect comprehensive hardware and software information from all managed hosts # Tags: system_info, inventory, monitoring # Author: Ansible Infrastructure Team - name: Gather comprehensive system information hosts: all become: true gather_facts: true vars: # Override these variables as needed system_info_stats_base_dir: "./stats/machines" system_info_json_indent: 2 pre_tasks: - name: Display playbook information debug: msg: - "==================================================" - "System Information Gathering Playbook" - "==================================================" - "Target hosts: {{ ansible_play_hosts | length }}" - "Statistics directory: {{ system_info_stats_base_dir }}" - "Timestamp: {{ ansible_date_time.iso8601 }}" - "==================================================" run_once: true tags: [always] roles: - role: system_info tags: [system_info] post_tasks: - name: Display completion summary debug: msg: - "==================================================" - "System Information Collection Complete" - "==================================================" - "Host: {{ ansible_fqdn }}" - "Statistics saved to: {{ system_info_stats_dir }}" - "Files created:" - " - system_info.json (latest)" - " - system_info_{{ ansible_date_time.epoch }}.json (backup)" - " - summary.txt (human-readable)" - "==================================================" tags: [always]