forked from crrlcx/ansible-pganalyze-collector
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- check connectivity when postgresql not stopped
- Loading branch information
Carrol Cox
committed
Aug 3, 2020
1 parent
ab73395
commit 664c3d6
Showing
4 changed files
with
16 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,6 @@ | |
*.orig | ||
*.tmp | ||
*.log | ||
|
||
*/__pycache__ | ||
*.pyc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,23 @@ | ||
--- | ||
# handlers file for ansible-pganalyze-collector | ||
- name: restart pganalyze-collector | ||
- name: handle pganalyze-collector service state is 'pgbouncer_service_state' | ||
service: | ||
name: pganalyze-collector | ||
state: "{{ pganalyze_service_state }}" | ||
enabled: true | ||
notify: | ||
- test pganalyze-collector | ||
listen: | ||
- restart pganalyze-collector | ||
|
||
- name: test pganalyze-collector | ||
- name: Check pganalyze-collector connectivity | ||
command: | | ||
pganalyze-collector --test | ||
register: pganalyze_test_result | ||
changed_when: false | ||
ignore_errors: false | ||
failed_when: | ||
- pganalyze_test_result.rc == 0 | ||
- "'Test submission successful' not in pganalyze_test_result.stderr" | ||
when: | ||
- pganalyze_service_state != 'stopped' | ||
- pganalyze_postgresql_state != 'stopped' | ||
listen: | ||
- restart pganalyze-collector |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,3 +31,5 @@ | |
environment: | ||
DEBIAN_FRONTEND: noninteractive | ||
RUNLEVEL: 1 | ||
notify: | ||
- restart pganalyze-collector |