-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathreporting.yml
58 lines (47 loc) · 1.45 KB
/
reporting.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
---
- name: start web service
hosts: "{{ web_server }}"
become: yes
tasks:
- name: ensure httpd package is latest
yum:
name: httpd
state: latest
- name: esnure httpd service is enabled and started
service:
name: httpd
enabled: yes
state: started
- name: basic inventory report including packages and services
hosts: all
ignore_unreachable: yes
vars:
file_path: /var/www/html
report_type: security_updates
tasks:
- name: gather installed packages data
package_facts:
- name: gather services data
service_facts:
- name: gather NVREA
shell: rpm -qa --queryformat "%{NAME} %{VERSION} %{RELEASE} %{EPOCH} %{ARCH}\n"
register: r_nvrea
when: report_type == "nvrea"
- name: value of r_NVREa
debug:
var: r_nvrea
- name: gather available security updates
shell: yum updateinfo list security | grep -ie rhsa
register: r_security_updates
when: report_type == "security_updates"
- name: run linux package and service report
include_role:
name: build_report_linux
post_tasks:
- name: gather public IP address
command: curl checkip.amazonaws.com
register: web_server_pulic_ip
delegate_to: "{{ web_server }}"
- name: URL to linux report
debug:
msg: "You can access your report at http://{{ web_server_pulic_ip.stdout }}/linux.html"