-
Notifications
You must be signed in to change notification settings - Fork 15
/
GatherInformationAboutOS.yml
42 lines (32 loc) · 1.13 KB
/
GatherInformationAboutOS.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# Author: jmutkawoa@cyberstorm.mu
# This Playbook will retrieve versions of Kernel, Networker, Shinken, BladeLogic and VMtool
# The output will be appended on a file in /tmp/rhelroot
---
- hosts: rhelroot
gather_facts: no
become: yes
become_method: sudo
tasks:
- name: Getting hostname version
shell: hostname
register: hostname
- name: Getting uname version
shell: uname -r
register: uname
- name:
shell: cat /etc/redhat-release
register: release
- name: Getting Networker version
shell: rpm -qa | egrep lgtoc
register: networker
- name: Getting Shinken version
shell: rpm -qa | egrep nrpe
register: nrpe
- name: Getting Bladelogic version
shell: cat /usr/nsh/Version
register: blade
- name: Getting vmtools version
shell: vmware-toolbox-cmd -v
register: vmtools
- name: Writing gathered data locally to file.
local_action: lineinfile line="{{ hostname.stdout, uname.stdout, release.stdout, networker.stdout, nrpe.stdout, blade.stdout, vmtools.stdout }}" insertafter=EOF dest=/tmp/rhelroot