55 lines
1.4 KiB
YAML
55 lines
1.4 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: Get epoch timestamp
|
|
shell: date +%s
|
|
register: timestamp
|
|
|
|
- name: Grab config - all servers
|
|
hosts: ServersWithConfigs
|
|
gather_facts: false
|
|
vars:
|
|
epoch: "{{ hostvars['localhost']['timestamp'].stdout }}"
|
|
tasks:
|
|
- block:
|
|
- include: tasks/grab-config.yaml
|
|
rescue:
|
|
- include: tasks/task-failed-slack.yaml
|
|
|
|
|
|
## BOInstall
|
|
- name: Uninstall BOInstall
|
|
hosts: BOInstall
|
|
gather_facts: false
|
|
tasks:
|
|
- block:
|
|
- include: tasks/uninstall-boinstall.yaml
|
|
rescue:
|
|
- include: tasks/task-failed-slack.yaml
|
|
|
|
## AxInstall
|
|
- name: Uninstall AXInstall
|
|
hosts: AOS
|
|
gather_facts: false
|
|
tasks:
|
|
- block:
|
|
- include: tasks/uninstall-axinstall.yaml
|
|
rescue:
|
|
- include: tasks/task-failed-slack.yaml
|
|
|
|
- name: Uninstall AXInstall - XppiL cleanup
|
|
hosts: AOS_POM
|
|
gather_facts: false
|
|
tasks:
|
|
- block:
|
|
- include: tasks/uninstall-axinstall-pom.yaml
|
|
rescue:
|
|
- include: tasks/task-failed-slack.yaml |