Files
ansible/oldstuff/start.yaml
2023-08-17 23:08:37 +02:00

84 lines
1.7 KiB
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 }}
- name: Start AOS
hosts: AOS
gather_facts: false
tasks:
- block:
- include: tasks/start-aos.yaml
rescue:
- include: tasks/task-failed-slack.yaml
- name: Start BCM_CLUSTER
hosts: BCM_CLUSTER
gather_facts: false
tasks:
- block:
- include: tasks/start-ifsbo.yaml
rescue:
- include: tasks/task-failed-slack.yaml
- name: Start APP
hosts: APP
gather_facts: false
tasks:
- block:
- include: tasks/start-iis.yaml
rescue:
- include: tasks/task-failed-slack.yaml
- name: Start DPS, FAS, MDL, SPS, TCS
hosts: DPS, FAS, MDL, SPS, TCS
gather_facts: false
tasks:
- block:
- include: tasks/start-ifsbo.yaml
rescue:
- include: tasks/task-failed-slack.yaml
- name: Start WEB, API
hosts: WEB, API
gather_facts: false
tasks:
- block:
- include: tasks/start-iis.yaml
rescue:
- include: tasks/task-failed-slack.yaml
#- name: Start Nagios
# hosts: SMC
# tasks:
# - name: podman start nagios
# command: podman start nagios
# - name: podman start n2a
# command: podman start n2a
- name: Slack
hosts: localhost
gather_facts: false
tasks:
- name: Send notification message via Slack
community.general.slack:
token: "{{ slack_token }}"
msg: All done