Introduce notification for other playbooks.
This commit is contained in:
19
hetzner.yaml
19
hetzner.yaml
@@ -5,6 +5,8 @@
|
|||||||
gather_facts: true
|
gather_facts: true
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
|
- name: Backup hetzner
|
||||||
|
block:
|
||||||
- include_vars: vars/hetzner/secret.yaml
|
- include_vars: vars/hetzner/secret.yaml
|
||||||
- include_vars: vars/hetzner/variable.yaml
|
- include_vars: vars/hetzner/variable.yaml
|
||||||
|
|
||||||
@@ -63,3 +65,20 @@
|
|||||||
file:
|
file:
|
||||||
path: "{{ backup_dir }}"
|
path: "{{ backup_dir }}"
|
||||||
state: absent
|
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
|
gather_facts: true
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
|
- name: Backup odroid
|
||||||
|
block:
|
||||||
- include_vars: vars/odroid/secret.yaml
|
- include_vars: vars/odroid/secret.yaml
|
||||||
- include_vars: vars/odroid/variable.yaml
|
- include_vars: vars/odroid/variable.yaml
|
||||||
|
|
||||||
@@ -197,3 +199,20 @@
|
|||||||
become: yes
|
become: yes
|
||||||
become_method: sudo
|
become_method: sudo
|
||||||
become_user: root
|
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