Extend nas playbook to inform mattermost.
This commit is contained in:
20
nas.yaml
20
nas.yaml
@@ -7,6 +7,7 @@
|
||||
tasks:
|
||||
- name: Backup odroid
|
||||
block:
|
||||
- include_vars: vars/common/variable.yaml
|
||||
|
||||
- name: Wakeup the nas
|
||||
community.general.wakeonlan:
|
||||
@@ -51,3 +52,22 @@
|
||||
path: /media/nas
|
||||
state: unmounted
|
||||
become: yes
|
||||
|
||||
- name: Inform Mattermost about success
|
||||
uri:
|
||||
url: "{{ mattermost_url }}"
|
||||
method: POST
|
||||
body_format: json
|
||||
body:
|
||||
username: "{{ mattermost_user }}"
|
||||
text: "{{ ansible_date_time.date }} {{ ansible_date_time.time }} (info): Playbook ran successful ({{ ansible_play_name }})"
|
||||
|
||||
rescue:
|
||||
- name: Inform Mattermost about error
|
||||
uri:
|
||||
url: "{{ mattermost_url }}"
|
||||
method: POST
|
||||
body_format: json
|
||||
body:
|
||||
username: "{{ mattermost_user }}"
|
||||
text: "{{ ansible_date_time.date }} {{ ansible_date_time.time }} (info): Playbook ran with error ({{ ansible_play_name }})"
|
||||
|
||||
Reference in New Issue
Block a user