Remove Mattermost information.
This commit is contained in:
@@ -5,10 +5,8 @@
|
|||||||
gather_facts: true
|
gather_facts: true
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
- name: Cleanup semaphore
|
- name: Include variables
|
||||||
block:
|
include_vars: vars/semaphore.yaml
|
||||||
- include_vars: vars/mattermost.yaml
|
|
||||||
- include_vars: vars/semaphore.yaml
|
|
||||||
|
|
||||||
- name: Search for volume's backup directories
|
- name: Search for volume's backup directories
|
||||||
become: yes
|
become: yes
|
||||||
@@ -120,30 +118,3 @@
|
|||||||
with_items: "{{ backup_files.results | map(attribute='files') | list }}"
|
with_items: "{{ backup_files.results | map(attribute='files') | list }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
label: "{{ item.path }}"
|
label: "{{ item.path }}"
|
||||||
|
|
||||||
- name: Inform Mattermost about success
|
|
||||||
uri:
|
|
||||||
url: "{{ mattermost_url }}"
|
|
||||||
method: POST
|
|
||||||
body_format: json
|
|
||||||
body:
|
|
||||||
channel_id: "{{ channel_id }}"
|
|
||||||
message: "{{ ansible_date_time.date }} {{ ansible_date_time.time }}: Playbook ran successful ({{ ansible_play_name }})"
|
|
||||||
headers:
|
|
||||||
Content-Type: application/json
|
|
||||||
Authorization: "Bearer {{ semaphore_token }}"
|
|
||||||
status_code: [200, 201]
|
|
||||||
|
|
||||||
rescue:
|
|
||||||
- name: Inform Mattermost about error
|
|
||||||
uri:
|
|
||||||
url: "{{ mattermost_url }}"
|
|
||||||
method: POST
|
|
||||||
body_format: json
|
|
||||||
body:
|
|
||||||
channel_id: "{{ channel_id }}"
|
|
||||||
message: "{{ ansible_date_time.date }} {{ ansible_date_time.time }}: Playbook ran with error ({{ ansible_play_name }})"
|
|
||||||
headers:
|
|
||||||
Content-Type: application/json
|
|
||||||
Authorization: "Bearer {{ error_token }}"
|
|
||||||
status_code: [200, 201]
|
|
||||||
|
|||||||
Reference in New Issue
Block a user