Skip to content

Commit c29d7fb

Browse files
author
NarendraPAutomationEngineer
committed
updated
1 parent 6bdafac commit c29d7fb

3 files changed

Lines changed: 88 additions & 0 deletions

File tree

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: sendNginxVersionInfo
3+
enabled: true
4+
runner_type: orquesta
5+
entry_point: workflows/sendNginxVersionInfo.yaml
6+
parameters:
7+
hostname:
8+
type: string
9+
required: true
10+
username:
11+
type: string
12+
required: true
13+
password:
14+
type: string
15+
required: true
16+
secret: true
17+
ToMail:
18+
type: string
19+
required: true
20+
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
version: 1.0
2+
input:
3+
- hostname
4+
- username
5+
- password
6+
- ToMail
7+
vars:
8+
- BData: None
9+
10+
tasks:
11+
VerifyNginxInstallation:
12+
action: core.remote
13+
input:
14+
cmd: "which nginx"
15+
hosts: <% ctx(hostname) %>
16+
username: <% ctx(username) %>
17+
password: <% ctx(password) %>
18+
next:
19+
- when: <% succeeded() %>
20+
do:
21+
- FindNginxVersion
22+
- when: <% failed() %>
23+
publish:
24+
- BData: "Sorry Nginx is not installed on server: <% ctx(hostname) %>"
25+
do:
26+
- SendMail
27+
28+
FindNginxVersion:
29+
action: core.remote
30+
input:
31+
cmd: "nginx -v 2>&1"
32+
hosts: <% ctx(hostname) %>
33+
username: <% ctx(username) %>
34+
password: <% ctx(password) %>
35+
next:
36+
- do:
37+
- SendMail
38+
publish:
39+
- Result: <% result().values() %>
40+
- Result: <% ctx(Result)[0] %>
41+
- BData: "The Nginx Version is <% ctx(Result).stdout %>"
42+
SendMail:
43+
action: gmail.sendMail
44+
input:
45+
Body: <% ctx(BData) %>
46+
Subject: "The Nginx Version info on <% ctx(hostname) %>"
47+
ToMail: <% ctx(ToMail) %>
48+
49+
output:
50+
- NginxInfo: <% ctx(BData) %>

mypractice/nginx/pack.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
ref: nginx
3+
name: nginx
4+
description: Simple pack to work with nginx
5+
keywords:
6+
- nginx
7+
- version
8+
version: 3.2.0
9+
python_versions:
10+
- "2"
11+
- "3"
12+
#dependencies:
13+
#- core
14+
author: Narendra P
15+
email: dowithscripting@gmail.com
16+
contributors:
17+
- "John Doe1 <john.doe1@gmail.com>"
18+
- "John Doe2 <john.doe2@gmail.com>"

0 commit comments

Comments
 (0)