Files
ansible/oldstuff/start-AX.yaml
2024-09-12 09:27:25 +00:00

30 lines
759 B
YAML

---
- name: Slack
hosts: localhost
gather_facts: false
vars:
playbook_file: "{{ (lookup('file', '/proc/self/cmdline') | regex_replace('\0',' ')).split() | select('match','^.*[.]ya?ml$') | list | first }}"
tasks:
- name: Send notification message via Slack
community.general.slack:
token: "{{ slack_token }}"
msg: Starting {{ playbook_file }}
- name: Start AOS
hosts: AOS
gather_facts: false
tasks:
- block:
- include: tasks/start-aos.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