-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: add missing pmie webhook action configuration functionality
- Loading branch information
Showing
6 changed files
with
108 additions
and
0 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
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
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# SPDX-License-Identifier: MIT | ||
--- | ||
- name: Check if primary pmie is running | ||
changed_when: false | ||
shell: | | ||
set -eu | ||
if set -o | grep -q pipefail; then | ||
set -o pipefail # no pipefail on debian, some ubuntu | ||
fi | ||
pmprobe -I pmcd.pmie.pmcd_host | grep '"primary"' | ||
when: (ansible_facts['distribution'] in ['RedHat', 'CentOS'] and | ||
ansible_facts['distribution_major_version'] | int > 6) or | ||
ansible_facts['distribution'] not in ['Fedora', 'RedHat', 'CentOS'] | ||
|
||
- name: Check if primary pmie uses webhook | ||
changed_when: false | ||
shell: | | ||
set -eu | ||
if set -o | grep -q pipefail; then | ||
set -o pipefail # no pipefail on debian, some ubuntu | ||
fi | ||
pmieconf -f /var/lib/pcp/config/pmie/config.default list global webhook_endpoint | grep '"example"' | ||
pmieconf -f /var/lib/pcp/config/pmie/config.default list global webhook_action | grep '"yes"' | ||
when: (ansible_distribution in ['RedHat', 'CentOS'] and | ||
(ansible_facts['distribution_version'] is version('9.3', '<'))) or | ||
ansible_distribution not in ['Fedora', 'RedHat', 'CentOS'] |
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# SPDX-License-Identifier: MIT | ||
--- | ||
- name: Test pmie webhook configuration | ||
hosts: all | ||
|
||
roles: | ||
- role: performancecopilot.metrics.pcp | ||
vars: | ||
pcp_pmie_endpoint: https://example.com:12345/webhook | ||
|
||
pre_tasks: | ||
- name: Skip test if not supported by platform | ||
meta: end_host | ||
when: (ansible_distribution in ['RedHat', 'CentOS'] and | ||
(ansible_facts['distribution_version'] is version('9.3', '<'))) or | ||
ansible_distribution not in ['Fedora', 'RedHat', 'CentOS'] | ||
|
||
- name: Save state of services | ||
import_tasks: get_services_state.yml | ||
|
||
tasks: | ||
- name: Check if configuring pmie webhook works | ||
include_tasks: check_pmie_webhook.yml | ||
|
||
post_tasks: | ||
- name: Restore state of services | ||
import_tasks: restore_services_state.yml |