31 lines
802 B
YAML
31 lines
802 B
YAML
---
|
|
- name: Slack
|
|
hosts: localhost
|
|
gather_facts: false
|
|
vars:
|
|
playbook_file: "{{ (lookup('file', '/proc/self/cmdline') | regex_replace('\u0000',' ')).split() | select('match','^.*[.]ya?ml$') | list | first }}"
|
|
tasks:
|
|
- name: Send notification message via Slack
|
|
community.general.slack:
|
|
token: "{{ slack_token }}"
|
|
msg: Starting {{ playbook_file }}
|
|
|
|
## BOInstall
|
|
- name: Install BOInstall
|
|
hosts: BOInstall
|
|
gather_facts: false
|
|
tasks:
|
|
- block:
|
|
- include: tasks/install-boinstall.yaml
|
|
rescue:
|
|
- include: tasks/task-failed-slack.yaml
|
|
|
|
- name: Slack
|
|
hosts: localhost
|
|
gather_facts: false
|
|
tasks:
|
|
- name: Send notification message via Slack
|
|
community.general.slack:
|
|
token: "{{ slack_token }}"
|
|
msg: All done
|