-
Notifications
You must be signed in to change notification settings - Fork 33
/
Copy pathviya-dbcheck.yml
26 lines (23 loc) · 1.01 KB
/
viya-dbcheck.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
####################################################################
#### viya-db.yml ####
####################################################################
#### Author: SAS Institute Inc. ####
####################################################################
#
# Copyright (c) 2019-2021, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
#
- name: Check SAS Infrastructure Data Server status - {{dbname}}
script: "viya-svs.sh checkdb {{dbname}} {{dbnum}}"
changed_when: false
register: dbrc
check_mode: no
- name: Display SAS Infrastructure Data Server status - {{dbname}}
debug: var=dbrc.stdout_lines
when: ansible_check_mode
- name: Fail task if DB is not running for start - {{dbname}}
fail:
msg:
- "ERROR: PGPool is not running"
- "This issue needs to be addressed before rerun the playbook."
when: not ansible_check_mode and dbrc.stdout is search('is not running')