-
Notifications
You must be signed in to change notification settings - Fork 193
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
26 changed files
with
1,464 additions
and
1 deletion.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
collections/ansible_collections/demo/patching/roles/report_ocp_patching/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
build_report_linux_patch | ||
======== | ||
|
||
Installs Apache and creates a report based on facts from Linux patching | ||
|
||
Requirements | ||
------------ | ||
|
||
Must run on Apache server | ||
|
||
Role Variables / Configuration | ||
-------------- | ||
|
||
N/A | ||
|
||
Dependencies | ||
------------ | ||
|
||
N/A | ||
|
||
Example Playbook | ||
---------------- | ||
|
||
The role can be used to create an html report on any number of Linux hosts using any number of Linux servers about their patching results(yum and dnf) | ||
|
||
|
||
``` | ||
--- | ||
- hosts: all | ||
tasks: | ||
- name: Run Windows Report | ||
import_role: | ||
name: shadowman.reports.build_report_linux_patch | ||
``` |
8 changes: 8 additions & 0 deletions
8
collections/ansible_collections/demo/patching/roles/report_ocp_patching/defaults/main.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
email_from: tower@shadowman.dev # noqa var-naming[no-role-prefix] - TODO : we should rework roles to use variable prefix, until scope is defined, silence is the way | ||
to_emails: alex@shadowman.dev,tower@shadowman.dev # noqa var-naming[no-role-prefix] - TODO : we should rework roles to use variable prefix, until scope is defined, silence is the way | ||
to_emails_list: "{{ to_emails.split(',') }}" # noqa var-naming[no-role-prefix] - TODO : we should rework roles to use variable prefix, until scope is defined, silence is the way | ||
detailedreport: true # noqa var-naming[no-role-prefix] - TODO : we should rework roles to use variable prefix, until scope is defined, silence is the way | ||
reports: # noqa var-naming[no-role-prefix] - TODO : we should rework roles to use variable prefix, until scope is defined, silence is the way | ||
- linux.html | ||
- linuxpatch.html |
Binary file added
BIN
+1.12 MB
...ections/demo/patching/roles/report_ocp_patching/example_results/Full_Report.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+108 KB
...roles/report_ocp_patching/example_results/Splunk Patching Aggregated RHEL 8.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
202 changes: 202 additions & 0 deletions
202
collections/ansible_collections/demo/patching/roles/report_ocp_patching/files/new.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,202 @@ | ||
p.hostname { | ||
color: #000000; | ||
font-weight: bolder; | ||
font-size: large; | ||
margin: auto; | ||
width: 50%; | ||
} | ||
|
||
#subtable { | ||
background: #ebebeb; | ||
margin: 0px; | ||
width: 100%; | ||
} | ||
|
||
#subtable tbody tr td { | ||
padding: 5px 5px 5px 5px; | ||
} | ||
|
||
#subtable thead th { | ||
padding: 5px; | ||
} | ||
|
||
* { | ||
-moz-box-sizing: border-box; | ||
-webkit-box-sizing: border-box; | ||
box-sizing: border-box; | ||
font-family: "Open Sans", "Helvetica"; | ||
|
||
} | ||
|
||
a { | ||
color: #ffffff; | ||
} | ||
|
||
p { | ||
color: #ffffff; | ||
} | ||
h1 { | ||
text-align: center; | ||
color: #ffffff; | ||
} | ||
|
||
body { | ||
background:#353a40; | ||
padding: 0px; | ||
margin: 0px; | ||
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; | ||
} | ||
|
||
table { | ||
border-collapse: separate; | ||
background:#fff; | ||
@include border-radius(5px); | ||
@include box-shadow(0px 0px 5px rgba(0,0,0,0.3)); | ||
} | ||
|
||
.main_net_table { | ||
margin:50px auto; | ||
} | ||
|
||
thead { | ||
@include border-radius(5px); | ||
} | ||
|
||
thead th { | ||
font-size:16px; | ||
font-weight:400; | ||
color:#fff; | ||
@include text-shadow(1px 1px 0px rgba(0,0,0,0.5)); | ||
text-align:left; | ||
padding:20px; | ||
border-top:1px solid #858d99; | ||
background: #353a40; | ||
|
||
&:first-child { | ||
@include border-top-left-radius(5px); | ||
} | ||
|
||
&:last-child { | ||
@include border-top-right-radius(5px); | ||
} | ||
} | ||
|
||
tbody tr td { | ||
font-weight:400; | ||
color:#5f6062; | ||
font-size:13px; | ||
padding:20px 20px 20px 20px; | ||
border-bottom:1px solid #e0e0e0; | ||
} | ||
|
||
tbody tr:nth-child(2n) { | ||
background:#f0f3f5; | ||
} | ||
|
||
tbody tr:last-child td { | ||
border-bottom:none; | ||
&:first-child { | ||
@include border-bottom-left-radius(5px); | ||
} | ||
&:last-child { | ||
@include border-bottom-right-radius(5px); | ||
} | ||
} | ||
|
||
td { | ||
vertical-align: top; | ||
} | ||
|
||
span.highlight { | ||
background-color: yellow; | ||
} | ||
|
||
.expandclass { | ||
color: #5f6062; | ||
} | ||
|
||
.content{ | ||
display:none; | ||
margin: 10px; | ||
} | ||
|
||
header { | ||
width: 100%; | ||
position: initial; | ||
float: initial; | ||
padding: 0; | ||
margin: 0; | ||
border-radius: 0; | ||
height: 88px; | ||
background-color: #171717; | ||
} | ||
|
||
.header-container { | ||
margin: 0 auto; | ||
width: 100%; | ||
height: 100%; | ||
max-width: 1170px; | ||
padding: 0; | ||
float: initial; | ||
display: flex; | ||
align-items: center; | ||
} | ||
|
||
.header-logo { | ||
width: 137px; | ||
border: 0; | ||
margin: 0; | ||
margin-left: 15px; | ||
} | ||
|
||
.header-link { | ||
margin-left: 40px; | ||
text-decoration: none; | ||
cursor: pointer; | ||
text-transform: uppercase; | ||
font-size: 15px; | ||
font-family: 'Red Hat Text'; | ||
font-weight: 500; | ||
} | ||
|
||
.header-link:hover { | ||
text-shadow: 0 0 0.02px white; | ||
text-decoration: none; | ||
} | ||
|
||
table.net_info td { | ||
padding: 5px; | ||
} | ||
|
||
p.expandclass:hover { | ||
text-decoration: underline; | ||
color: #EE0000; | ||
cursor: pointer; | ||
} | ||
|
||
.summary_info { | ||
} | ||
|
||
.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active, a.ui-button:active, .ui-button:active, .ui-button.ui-state-active:hover { | ||
border: 1px solid #5F0000; | ||
background: #EE0000; | ||
} | ||
|
||
div#net_content { | ||
padding: 0px; | ||
height: auto !important; | ||
} | ||
|
||
img.router_image { | ||
vertical-align: middle; | ||
padding: 0px 10px 10px 10px; | ||
width: 50px; | ||
} | ||
|
||
table.net_info { | ||
width: 100%; | ||
} | ||
|
||
p.internal_label { | ||
color: #000000; | ||
} |
48 changes: 48 additions & 0 deletions
48
...llections/demo/patching/roles/report_ocp_patching/files/redhat-ansible-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+2.05 KB
...ns/ansible_collections/demo/patching/roles/report_ocp_patching/files/report.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+3.78 KB
...ns/ansible_collections/demo/patching/roles/report_ocp_patching/files/server.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+44.8 KB
...ible_collections/demo/patching/roles/report_ocp_patching/files/webpage_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 22 additions & 0 deletions
22
collections/ansible_collections/demo/patching/roles/report_ocp_patching/tasks/main.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--- | ||
- name: Define namespace | ||
redhat.openshift.k8s: | ||
wait: true | ||
state: present | ||
api_version: v1 | ||
kind: Namespace | ||
name: patching-report | ||
|
||
- name: Define deployment resources | ||
redhat.openshift.k8s: | ||
wait: true | ||
state: present | ||
namespace: patching-report | ||
definition: "{{ lookup('ansible.builtin.template', 'resources.yaml') }}" | ||
register: resources_output | ||
|
||
- name: Display link to patching report | ||
ansible.builtin.debug: | ||
msg: | ||
- "Patching report availbable at:" | ||
- "{{ resources_output.result.results[3].result.spec.port.targetPort }}://{{ resources_output.result.results[3].result.spec.host }}" |
15 changes: 15 additions & 0 deletions
15
collections/ansible_collections/demo/patching/roles/report_ocp_patching/templates/header.j2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
|
||
|
||
<div class="wrapper"> | ||
<header> | ||
<div class="header-container"> | ||
<a href="https://ansible.com"> | ||
<img | ||
class="header-logo" | ||
src="redhat-ansible-logo.svg" | ||
title="Red Hat Ansible" | ||
alt="Red Hat Ansible" | ||
/> | ||
</a> | ||
</div> | ||
</header> |
41 changes: 41 additions & 0 deletions
41
collections/ansible_collections/demo/patching/roles/report_ocp_patching/templates/landing.j2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title> Ansible Linux Automation Report </title> | ||
<link rel="stylesheet" type="text/css" href="//fonts.googleapis.com/css?family=Open+Sans" /> | ||
<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css"> | ||
<link rel="stylesheet" href="new.css"> | ||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script> | ||
<script src="https://code.jquery.com/jquery-1.12.4.js"></script> | ||
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script> | ||
<script src="https://www.kryogenix.org/code/browser/sorttable/sorttable.js"></script> | ||
</head> | ||
<body> | ||
<div class="wrapper"> | ||
{% include 'header.j2' %} | ||
<section> | ||
<center> | ||
<h1>Ansible Automation Reports</h1> | ||
<h3><input type="search" placeholder="Search..." class="form-control search-input" data-table="main_net_table"/> | ||
</center> | ||
<table class="table table-striped mt32 main_net_table"> | ||
<tbody> | ||
{% for report in reports %} | ||
<tr> | ||
<td class="summary_info"> | ||
<div id="hostname"> | ||
<p class="hostname"> <img class="router_image" src="report.png"></p> | ||
</div> | ||
</td> | ||
<td> | ||
<a href="{{ report }}"> {{ report }} <a> | ||
</td> | ||
{% endfor %} | ||
</tbody> | ||
</table> | ||
<center><p>Created with</p><br><img src="webpage_logo.png" width="300"> | ||
</center> | ||
</section> | ||
</div> | ||
</body> | ||
</html> |
Oops, something went wrong.