-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.yml
60 lines (50 loc) · 1.41 KB
/
main.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
59
60
---
- name: set basic environment in localhost
hosts: localhost
gather_facts: yes
tasks:
- name: get_time zone to convert AWX container time zone UTC
command: "date '+%Y-%b-%d_%H:%M'"
register: AU_timez
environment:
TZ: Australia/Sydney
- name: print out time zone
debug:
msg: "{{AU_timez}}"
tags: print_output
- name: define name variables
set_facts:
html_name: "{{project_name}}_report_{{INVENTORY_LOCATION}}.html"
Now_time: "{{AU_timez.stdout}}"
Year: "{{AU_timez.stdout.split(-)[0]}}"
cacheable: yes
delegate_to: localhost
- name: print_output
debug:
msg: "{{lookup('pipe', 'pwd')}}
{{lookup('pipe', 'whoami')}}
{{inventory_hostname}}"
tags: print_output
- name: create log file
blockinfile:
create: yes
dest: "{{dest_file}}"
content: |
"
<h1>***{{Now_time}}
*location*{{INVENTORY_LOCATION}}
**{{project_name}}**
</h1>
"
delegate_to: localhost
- name: run network device command playbook
hosts: "{{group_run_command}}"
gather_facts: no
roles:
- execute
- name: create html from templates
hosts: localhost
gather_facts: no
roles:
- create_html
- push_artifactory