-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCreateHTMLinventory.yml
More file actions
40 lines (31 loc) · 962 Bytes
/
CreateHTMLinventory.yml
File metadata and controls
40 lines (31 loc) · 962 Bytes
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
---
- name: build Linux OS report
hosts: all
gather_facts: true
vars:
www_dir: ''
os_html_dir: "{{ www_dir }}"
os_inv_file: "{{ os_html_dir }}/osreport.html"
tasks:
- name: 'Preflight Varible check :: www_dir'
fail: msg='Please include the www_dir to the variable "www_dir"'
run_once: true
when: 'www_dir is not defined'
- name: 'Preflight Varible check :: slack_token'
fail: msg='Please include the slack_token to the variable "slack_token"'
run_once: true
when: 'slack_token is not defined'
- name: create HTML report
template:
src: report-osversion.j2
dest: "{{ os_inv_file }}"
delegate_to: towerhost
run_once: true
- name: Send Alert to Slack
slack:
token: "{{ slack_token }}"
msg: 'OS Invetory report created http://172.16.1.25:8080/osreport.html'
channel: '#toweralerts'
username: 'Ansible Tower'
run_once: true
delegate_to: towerhost