Skip to content

Commit

Permalink
Squashed 'vendor/github.com/performancecopilot/ansible-pcp/' changes …
Browse files Browse the repository at this point in the history
…from ead14d3..6cbb8cc

6cbb8cc Bump version to 2.3.0 for latest changes
35389e7 feat: support for ostree systems
630e87e fix: add missing pmie webhook action configuration functionality
e50979a fix: switch the repository role over to using Packagecloud

git-subtree-dir: vendor/github.com/performancecopilot/ansible-pcp
git-subtree-split: 6cbb8cc0accebed05985390e677ac1a760294803
  • Loading branch information
richm committed Nov 28, 2023
1 parent 6822400 commit d5f5c1c
Show file tree
Hide file tree
Showing 25 changed files with 279 additions and 56 deletions.
28 changes: 28 additions & 0 deletions tests/check_pmie_webhook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# 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']

# yamllint disable rule:line-length
- 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']
# yamllint enable rule:line-length
20 changes: 8 additions & 12 deletions tests/tests_verify_mssql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,28 +19,24 @@
- name: Save state of services
import_tasks: get_services_state.yml

- name: Ensure correct package manager for ostree systems
vars:
ostree_pkg_mgr: ansible.posix.rhel_rpm_ostree
ostree_booted_file: /run/ostree-booted
when: ansible_facts.pkg_mgr | d("") != ostree_pkg_mgr
- name: Determine if system is ostree and set flag
when: not __ansible_pcp_is_ostree is defined
block:
- name: Check if system is ostree
stat:
path: "{{ ostree_booted_file }}"
path: /run/ostree-booted
register: __ostree_booted_stat

- name: Set package manager to use for ostree
ansible.utils.update_fact:
updates:
- path: ansible_facts.pkg_mgr
value: "{{ ostree_pkg_mgr }}"
when: __ostree_booted_stat.stat.exists
- name: Set flag to indicate system is ostree
set_fact:
__ansible_pcp_is_ostree: "{{ __ostree_booted_stat.stat.exists }}"

- name: Ensure python3-pyodbc is installed
package:
name: python3-pyodbc
state: present
use: "{{ (__ansible_pcp_is_ostree | d(false)) |
ternary('ansible.posix.rhel_rpm_ostree', omit) }}"

tasks:
- name: Check MSSQL functionality
Expand Down
27 changes: 27 additions & 0 deletions tests/tests_verify_pmie_webhook.yml
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
22 changes: 9 additions & 13 deletions tests/tests_verify_postfix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,30 +18,26 @@
- name: Save state of services
import_tasks: get_services_state.yml

- name: Ensure correct package manager for ostree systems
vars:
ostree_pkg_mgr: ansible.posix.rhel_rpm_ostree
ostree_booted_file: /run/ostree-booted
when: ansible_facts.pkg_mgr | d("") != ostree_pkg_mgr
- name: Determine if system is ostree and set flag
when: not __ansible_pcp_is_ostree is defined
block:
- name: Check if system is ostree
stat:
path: "{{ ostree_booted_file }}"
path: /run/ostree-booted
register: __ostree_booted_stat

- name: Set package manager to use for ostree
ansible.utils.update_fact:
updates:
- path: ansible_facts.pkg_mgr
value: "{{ ostree_pkg_mgr }}"
when: __ostree_booted_stat.stat.exists
- name: Set flag to indicate system is ostree
set_fact:
__ansible_pcp_is_ostree: "{{ __ostree_booted_stat.stat.exists }}"

- name: Ensure postfix is installed
- name: Ensure Postfix is installed
package:
name:
- postfix
- postfix-perl-scripts
state: present
use: "{{ (__ansible_pcp_is_ostree | d(false)) |
ternary('ansible.posix.rhel_rpm_ostree', omit) }}"

# needed for older versions of PCP which mandated a log file
# exists in order that the PMDA would start up at all.
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions vendor/github.com/performancecopilot/ansible-pcp/galaxy.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit d5f5c1c

Please sign in to comment.