Skip to content

Commit 1abc97e

Browse files
committed
Add OCP-CNV patching demo
1 parent 3468d1c commit 1abc97e

26 files changed

+1464
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
build_report_linux_patch
2+
========
3+
4+
Installs Apache and creates a report based on facts from Linux patching
5+
6+
Requirements
7+
------------
8+
9+
Must run on Apache server
10+
11+
Role Variables / Configuration
12+
--------------
13+
14+
N/A
15+
16+
Dependencies
17+
------------
18+
19+
N/A
20+
21+
Example Playbook
22+
----------------
23+
24+
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)
25+
26+
27+
```
28+
---
29+
- hosts: all
30+
31+
tasks:
32+
- name: Run Windows Report
33+
import_role:
34+
name: shadowman.reports.build_report_linux_patch
35+
36+
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
email_from: [email protected] # noqa var-naming[no-role-prefix] - TODO : we should rework roles to use variable prefix, until scope is defined, silence is the way
3+
to_emails: [email protected],[email protected] # noqa var-naming[no-role-prefix] - TODO : we should rework roles to use variable prefix, until scope is defined, silence is the way
4+
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
5+
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
6+
reports: # noqa var-naming[no-role-prefix] - TODO : we should rework roles to use variable prefix, until scope is defined, silence is the way
7+
- linux.html
8+
- linuxpatch.html
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,202 @@
1+
p.hostname {
2+
color: #000000;
3+
font-weight: bolder;
4+
font-size: large;
5+
margin: auto;
6+
width: 50%;
7+
}
8+
9+
#subtable {
10+
background: #ebebeb;
11+
margin: 0px;
12+
width: 100%;
13+
}
14+
15+
#subtable tbody tr td {
16+
padding: 5px 5px 5px 5px;
17+
}
18+
19+
#subtable thead th {
20+
padding: 5px;
21+
}
22+
23+
* {
24+
-moz-box-sizing: border-box;
25+
-webkit-box-sizing: border-box;
26+
box-sizing: border-box;
27+
font-family: "Open Sans", "Helvetica";
28+
29+
}
30+
31+
a {
32+
color: #ffffff;
33+
}
34+
35+
p {
36+
color: #ffffff;
37+
}
38+
h1 {
39+
text-align: center;
40+
color: #ffffff;
41+
}
42+
43+
body {
44+
background:#353a40;
45+
padding: 0px;
46+
margin: 0px;
47+
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
48+
}
49+
50+
table {
51+
border-collapse: separate;
52+
background:#fff;
53+
@include border-radius(5px);
54+
@include box-shadow(0px 0px 5px rgba(0,0,0,0.3));
55+
}
56+
57+
.main_net_table {
58+
margin:50px auto;
59+
}
60+
61+
thead {
62+
@include border-radius(5px);
63+
}
64+
65+
thead th {
66+
font-size:16px;
67+
font-weight:400;
68+
color:#fff;
69+
@include text-shadow(1px 1px 0px rgba(0,0,0,0.5));
70+
text-align:left;
71+
padding:20px;
72+
border-top:1px solid #858d99;
73+
background: #353a40;
74+
75+
&:first-child {
76+
@include border-top-left-radius(5px);
77+
}
78+
79+
&:last-child {
80+
@include border-top-right-radius(5px);
81+
}
82+
}
83+
84+
tbody tr td {
85+
font-weight:400;
86+
color:#5f6062;
87+
font-size:13px;
88+
padding:20px 20px 20px 20px;
89+
border-bottom:1px solid #e0e0e0;
90+
}
91+
92+
tbody tr:nth-child(2n) {
93+
background:#f0f3f5;
94+
}
95+
96+
tbody tr:last-child td {
97+
border-bottom:none;
98+
&:first-child {
99+
@include border-bottom-left-radius(5px);
100+
}
101+
&:last-child {
102+
@include border-bottom-right-radius(5px);
103+
}
104+
}
105+
106+
td {
107+
vertical-align: top;
108+
}
109+
110+
span.highlight {
111+
background-color: yellow;
112+
}
113+
114+
.expandclass {
115+
color: #5f6062;
116+
}
117+
118+
.content{
119+
display:none;
120+
margin: 10px;
121+
}
122+
123+
header {
124+
width: 100%;
125+
position: initial;
126+
float: initial;
127+
padding: 0;
128+
margin: 0;
129+
border-radius: 0;
130+
height: 88px;
131+
background-color: #171717;
132+
}
133+
134+
.header-container {
135+
margin: 0 auto;
136+
width: 100%;
137+
height: 100%;
138+
max-width: 1170px;
139+
padding: 0;
140+
float: initial;
141+
display: flex;
142+
align-items: center;
143+
}
144+
145+
.header-logo {
146+
width: 137px;
147+
border: 0;
148+
margin: 0;
149+
margin-left: 15px;
150+
}
151+
152+
.header-link {
153+
margin-left: 40px;
154+
text-decoration: none;
155+
cursor: pointer;
156+
text-transform: uppercase;
157+
font-size: 15px;
158+
font-family: 'Red Hat Text';
159+
font-weight: 500;
160+
}
161+
162+
.header-link:hover {
163+
text-shadow: 0 0 0.02px white;
164+
text-decoration: none;
165+
}
166+
167+
table.net_info td {
168+
padding: 5px;
169+
}
170+
171+
p.expandclass:hover {
172+
text-decoration: underline;
173+
color: #EE0000;
174+
cursor: pointer;
175+
}
176+
177+
.summary_info {
178+
}
179+
180+
.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 {
181+
border: 1px solid #5F0000;
182+
background: #EE0000;
183+
}
184+
185+
div#net_content {
186+
padding: 0px;
187+
height: auto !important;
188+
}
189+
190+
img.router_image {
191+
vertical-align: middle;
192+
padding: 0px 10px 10px 10px;
193+
width: 50px;
194+
}
195+
196+
table.net_info {
197+
width: 100%;
198+
}
199+
200+
p.internal_label {
201+
color: #000000;
202+
}
Loading
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
- name: Define namespace
3+
redhat.openshift.k8s:
4+
wait: true
5+
state: present
6+
api_version: v1
7+
kind: Namespace
8+
name: patching-report
9+
10+
- name: Define deployment resources
11+
redhat.openshift.k8s:
12+
wait: true
13+
state: present
14+
namespace: patching-report
15+
definition: "{{ lookup('ansible.builtin.template', 'resources.yaml') }}"
16+
register: resources_output
17+
18+
- name: Display link to patching report
19+
ansible.builtin.debug:
20+
msg:
21+
- "Patching report availbable at:"
22+
- "{{ resources_output.result.results[3].result.spec.port.targetPort }}://{{ resources_output.result.results[3].result.spec.host }}"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
2+
3+
<div class="wrapper">
4+
<header>
5+
<div class="header-container">
6+
<a href="https://ansible.com">
7+
<img
8+
class="header-logo"
9+
src="redhat-ansible-logo.svg"
10+
title="Red Hat Ansible"
11+
alt="Red Hat Ansible"
12+
/>
13+
</a>
14+
</div>
15+
</header>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title> Ansible Linux Automation Report </title>
5+
<link rel="stylesheet" type="text/css" href="//fonts.googleapis.com/css?family=Open+Sans" />
6+
<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
7+
<link rel="stylesheet" href="new.css">
8+
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
9+
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
10+
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
11+
<script src="https://www.kryogenix.org/code/browser/sorttable/sorttable.js"></script>
12+
</head>
13+
<body>
14+
<div class="wrapper">
15+
{% include 'header.j2' %}
16+
<section>
17+
<center>
18+
<h1>Ansible Automation Reports</h1>
19+
<h3><input type="search" placeholder="Search..." class="form-control search-input" data-table="main_net_table"/>
20+
</center>
21+
<table class="table table-striped mt32 main_net_table">
22+
<tbody>
23+
{% for report in reports %}
24+
<tr>
25+
<td class="summary_info">
26+
<div id="hostname">
27+
<p class="hostname"> <img class="router_image" src="report.png"></p>
28+
</div>
29+
</td>
30+
<td>
31+
<a href="{{ report }}"> {{ report }} <a>
32+
</td>
33+
{% endfor %}
34+
</tbody>
35+
</table>
36+
<center><p>Created with</p><br><img src="webpage_logo.png" width="300">
37+
</center>
38+
</section>
39+
</div>
40+
</body>
41+
</html>

0 commit comments

Comments
 (0)