Integrate user for mattermost into playbooks.

This commit is contained in:
chsteinle
2021-11-30 08:33:20 +01:00
parent a344941c0e
commit f81024e9c3
4 changed files with 17 additions and 6 deletions

View File

@@ -7,6 +7,7 @@
tasks:
- name: Backup hetzner
block:
- include_vars: vars/common/variable.yaml
- include_vars: vars/hetzner/secret.yaml
- include_vars: vars/hetzner/variable.yaml
@@ -68,19 +69,21 @@
- name: Inform Mattermost about success
uri:
url: https://cs-mm.ddnss.de/hooks/og4ckuqet7fafb8kjuaigzuh7c
url: "{{ mattermost_url }}"
validate_certs: no
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: https://cs-mm.ddnss.de/hooks/og4ckuqet7fafb8kjuaigzuh7c
url: "{{ mattermost_url }}"
validate_certs: no
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 }})"

View File

@@ -7,6 +7,7 @@
tasks:
- name: Backup odroid
block:
- include_vars: vars/common/variable.yaml
- include_vars: vars/odroid/secret.yaml
- include_vars: vars/odroid/variable.yaml
@@ -202,17 +203,19 @@
- name: Inform Mattermost about success
uri:
url: https://cs-mm.ddnss.de/hooks/og4ckuqet7fafb8kjuaigzuh7c
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: https://cs-mm.ddnss.de/hooks/og4ckuqet7fafb8kjuaigzuh7c
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 }})"

View File

@@ -7,6 +7,7 @@
tasks:
- name: Cleanup semaphore
block:
- include_vars: vars/common/variable.yaml
- include_vars: vars/semaphore/variable.yaml
- name: Search for volume's backup directories
@@ -122,17 +123,19 @@
- name: Inform Mattermost about success
uri:
url: https://cs-mm.ddnss.de/hooks/og4ckuqet7fafb8kjuaigzuh7c
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: https://cs-mm.ddnss.de/hooks/og4ckuqet7fafb8kjuaigzuh7c
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 }})"

View File

@@ -0,0 +1,2 @@
mattermost_url: https://cs-mm.ddnss.de/hooks/og4ckuqet7fafb8kjuaigzuh7c
mattermost_user: semaphore