Introduce notification for other playbooks.
This commit is contained in:
19
hetzner.yaml
19
hetzner.yaml
@@ -5,6 +5,8 @@
|
||||
gather_facts: true
|
||||
|
||||
tasks:
|
||||
- name: Backup hetzner
|
||||
block:
|
||||
- include_vars: vars/hetzner/secret.yaml
|
||||
- include_vars: vars/hetzner/variable.yaml
|
||||
|
||||
@@ -63,3 +65,20 @@
|
||||
file:
|
||||
path: "{{ backup_dir }}"
|
||||
state: absent
|
||||
|
||||
- name: Inform Mattermost about success
|
||||
uri:
|
||||
url: https://cs-mm.ddnss.de/hooks/og4ckuqet7fafb8kjuaigzuh7c
|
||||
method: POST
|
||||
body_format: json
|
||||
body:
|
||||
text: "{{ ansible_date_time.date }} {{ ansible_date_time.time }} (info): Playbook ran successful ({{ ansible_play_name }})"
|
||||
|
||||
rescue:
|
||||
- name: Inform Mattermost about error
|
||||
uri:
|
||||
url: https://cs-mm.ddnss.de/hooks/og4ckuqet7fafb8kjuaigzuh7c
|
||||
method: POST
|
||||
body_format: json
|
||||
body:
|
||||
text: "{{ ansible_date_time.date }} {{ ansible_date_time.time }} (info): Playbook ran with error ({{ ansible_play_name }})"
|
||||
|
||||
19
odroid.yaml
19
odroid.yaml
@@ -5,6 +5,8 @@
|
||||
gather_facts: true
|
||||
|
||||
tasks:
|
||||
- name: Backup odroid
|
||||
block:
|
||||
- include_vars: vars/odroid/secret.yaml
|
||||
- include_vars: vars/odroid/variable.yaml
|
||||
|
||||
@@ -197,3 +199,20 @@
|
||||
become: yes
|
||||
become_method: sudo
|
||||
become_user: root
|
||||
|
||||
- name: Inform Mattermost about success
|
||||
uri:
|
||||
url: https://cs-mm.ddnss.de/hooks/og4ckuqet7fafb8kjuaigzuh7c
|
||||
method: POST
|
||||
body_format: json
|
||||
body:
|
||||
text: "{{ ansible_date_time.date }} {{ ansible_date_time.time }} (info): Playbook ran successful ({{ ansible_play_name }})"
|
||||
|
||||
rescue:
|
||||
- name: Inform Mattermost about error
|
||||
uri:
|
||||
url: https://cs-mm.ddnss.de/hooks/og4ckuqet7fafb8kjuaigzuh7c
|
||||
method: POST
|
||||
body_format: json
|
||||
body:
|
||||
text: "{{ ansible_date_time.date }} {{ ansible_date_time.time }} (info): Playbook ran with error ({{ ansible_play_name }})"
|
||||
|
||||
Reference in New Issue
Block a user