syncing more examples

This commit is contained in:
ipvsean
2020-03-03 09:05:23 -05:00
parent 4e640b213f
commit a690993ec0
7 changed files with 87 additions and 12 deletions

View File

@@ -0,0 +1,9 @@
- name: create HTML report
become: yes
template:
src: report.j2
dest: "{{ file_path }}"
- name: DISPLAY LINK TO INVENTORY REPORT
debug:
msg: "Please go to http://{{ansible_host}}/report"

View File

@@ -0,0 +1,37 @@
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="css/main.css">
</head>
<h1>Developer Report</h1>
<body>
<table>
<thead>
<tr>
<th>Hostname</th>
<th>Operating System</th>
<th>PATH</th>
<th>Kernel</th>
<th>Python Version</th>
<th>Package Manager</th>
<th>System Date Time</td>
</tr>
</thead>
<tbody>
{% for linux_node in groups['all'] %}
<tr>
<td>{{hostvars[linux_node]['ansible_hostname']}}</td>
<td>{{hostvars[linux_node]['ansible_distribution']}} {{hostvars[linux_node]['ansible_distribution_version']}}</td>
<td>{{hostvars[linux_node]['ansible_env']['PATH']}}</td>
<td>{{hostvars[linux_node]['ansible_kernel']}}</td>
<td>{{hostvars[linux_node]['ansible_python_version']}}</td>
<td>{{hostvars[linux_node]['ansible_pkg_mgr']}}</td>
<td>{{hostvars[linux_node]['ansible_date_time']['date']}}</td>
</tr>
{% endfor %}
</tbody>
</table>
</body>
</html>