-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path12_mail_function.yml
47 lines (38 loc) · 1.49 KB
/
12_mail_function.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
---
- name: "This Is The Template Program"
hosts: localhost
gather_facts: true
vars:
team: "Linux Team"
tasks:
- name: "Block to Execute EMC HBA && LUN Validation Loading."
block:
- name: "Executing Script to fetch and Create Results and Store In File"
ansible.builtin.script:
cmd: "library/hba_lun_validation_script.sh"
- name: "Read Content of A File Post Script Run"
ansible.builtin.command:
cmd: cat /tmp/{{ ansible_nodename }}_HBA_LUN_Details.csv
register: hba_lun_data
changed_when: false
- name: "Display Content"
ansible.builtin.debug:
msg: "{{ hba_lun_data.stdout_lines }}"
- name: "Creating Template To print In Table" # noqa: run_once[task]
ansible.builtin.template:
src: "12_mail_function.html.j2"
dest: "/var/www/html/index.html"
mode: "0677"
become: true
delegate_to: localhost
run_once: true
# - name: "Including Mail File -> Include Task mail_trigger.yml"
# ansible.builtin.include_tasks:
# file: mail_trigger.yml
rescue:
- name: "Any Tasks Failed"
ansible.builtin.fail:
msg:
- "ERROR OCCURRED IN, ROLE: EMC_HBA_and_LUN_validation_for_linux, PLAYBOOK: task/main.yml"
- "FAILED TASK NAME : {{ ansible_failed_task.name }}"
- "FAILED WITH ERROR: {{ ansible_failed_result.msg }}"