This commit is contained in:
2026-01-12 14:01:56 +01:00
parent e656145b0f
commit 3fdbdc65da
10 changed files with 829 additions and 0 deletions

29
report.yml Normal file
View File

@@ -0,0 +1,29 @@
---
- name: Collect OS info and generate report
hosts: all
gather_facts: yes
tasks:
- name: Build server info string
set_fact:
server_info: "{{ inventory_hostname }} - {{ ansible_distribution }} {{ ansible_distribution_version }}"
- name: Add server info to a central list
run_once: true
set_fact:
os_report: []
- name: Collect server info into report
set_fact:
os_report: "{{ os_report + [hostvars[item].server_info] }}"
with_items: "{{ ansible_play_hosts }}"
run_once: true
- name: Write report to file on control node
copy:
dest: "./os-report.txt"
content: |
{% for line in os_report %}
{{ line }}
{% endfor %}
run_once: true
delegate_to: localhost