syncing more examples
This commit is contained in:
9
roles/developer_report/tasks/main.yml
Normal file
9
roles/developer_report/tasks/main.yml
Normal 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"
|
||||
37
roles/developer_report/templates/report.j2
Normal file
37
roles/developer_report/templates/report.j2
Normal 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>
|
||||
Reference in New Issue
Block a user