Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add alerts support #218

Merged
merged 6 commits into from
Aug 1, 2024
Merged

Conversation

idevat
Copy link
Contributor

@idevat idevat commented Jul 30, 2024

Enhancement:
Add support for configuring Pacemaker Alerts

Reason:
This is necessary so that users can configure alerts to take some external action when a cluster event occurs (node failure, resource starting or stopping, etc.)

Result:
It is now possible to configure Pacemaker Alerts using the role

Issue Tracker Tickets (Jira or BZ if any):
https://issues.redhat.com/browse/RHEL-45285

Copy link

codecov bot commented Jul 30, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 68.50%. Comparing base (06093e4) to head (533e9be).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #218   +/-   ##
=======================================
  Coverage   68.50%   68.50%           
=======================================
  Files           3        3           
  Lines         181      181           
=======================================
  Hits          124      124           
  Misses         57       57           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@tomjelinek
Copy link
Member

[citest]

README.md Outdated Show resolved Hide resolved
@idevat
Copy link
Contributor Author

idevat commented Jul 31, 2024

@richm, regarding failing checks:

Most of fails are because of passlib. We can deal with them in another pull request (maybe as suggested here #216 (comment)) and finish this pull request afterwards.

In other cases, it looks like issues of CI itself. So can someone responsible for CI look into this, please?
Details:

  1. CentOS-Stream-8/ansible-2.17:
TASK [Gathering Facts] *********************************************************
task path: /WORKDIR/git-add-alerts-supportnsvicjcx/tests/tests_cib_alerts.yml:9
Tuesday 30 July 2024  14:05:55 +0000 (0:00:00.012)       0:00:00.035 ********** 
fatal: [sut]: FAILED! => {
    "ansible_facts": {},
    "changed": false,
    "failed_modules": {
        "ansible.legacy.setup": {
            "ansible_facts": {
                "discovered_interpreter_python": "/usr/bin/python3"
            },
            "failed": true,
            "module_stderr": "OpenSSH_8.7p1, OpenSSL 3.0.7 1 Nov 2022\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: Reading configuration data /etc/ssh/ssh_config.d/50-redhat.conf\r\ndebug2: checking match for 'final all' host 10.31.10.135 originally 10.31.10.135\r\ndebug2: match not found\r\ndebug1: Reading configuration data /etc/crypto-policies/back-ends/openssh.config\r\ndebug1: /etc/ssh/ssh_config line 56: Applying options for *\r\ndebug1: configuration requests final Match pass\r\ndebug2: resolve_canonicalize: hostname 10.31.10.135 is address\r\ndebug1: re-parsing configuration\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: Reading configuration data /etc/ssh/ssh_config.d/50-redhat.conf\r\ndebug2: checking match for 'final all' host 10.31.10.135 originally 10.31.10.135\r\ndebug2: match found\r\ndebug1: Reading configuration data /etc/crypto-policies/back-ends/openssh.config\r\ndebug1: /etc/ssh/ssh_config line 56: Applying options for *\r\ndebug1: auto-mux: Trying existing master\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug2: mux_client_hello_exchange: master version 4\r\ndebug1: mux_client_request_session: master session id: 2\r\nTraceback (most recent call last):\n  File \"<stdin>\", line 107, in <module>\n  File \"<stdin>\", line 99, in _ansiballz_main\n  File \"<stdin>\", line 44, in invoke_module\n  File \"<frozen importlib._bootstrap>\", line 971, in _find_and_load\n  File \"<frozen importlib._bootstrap>\", line 951, in _find_and_load_unlocked\n  File \"<frozen importlib._bootstrap>\", line 894, in _find_spec\n  File \"<frozen importlib._bootstrap_external>\", line 1157, in find_spec\n  File \"<frozen importlib._bootstrap_external>\", line 1131, in _get_spec\n  File \"<frozen importlib._bootstrap_external>\", line 1112, in _legacy_get_spec\n  File \"<frozen importlib._bootstrap>\", line 441, in spec_from_loader\n  File \"<frozen importlib._bootstrap_external>\", line 544, in spec_from_file_location\n  File \"/tmp/ansible_ansible.legacy.setup_payload_s2gptukh/ansible_ansible.legacy.setup_payload.zip/ansible/module_utils/basic.py\", line 5\nSyntaxError: future feature annotations is not defined\ndebug2: Received exit status from master 1\r\n",
            "module_stdout": "",
            "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
            "rc": 1,
            "warnings": [
                "Platform linux on host sut is using the discovered Python interpreter at /usr/bin/python3, but future installation of another Python interpreter could change the meaning of that path. See https://docs.ansible.com/ansible-core/2.17/reference_appendices/interpreter_discovery.html for more information."
            ]
        }
    }
}

MSG:

The following modules failed to execute: ansible.legacy.setup

	to retry, use: --limit @/tmp/tests_cib_alerts.retry
  1. CentOS-Stream-8|ansible-2.16

TASK [fedora.linux_system_roles.ha_cluster : Install role essential packages] ***
task path: /tmp/tmp.4RYOP7BSHm/ansible_collections/fedora/linux_system_roles/roles/ha_cluster/tasks/main.yml:11
Tuesday 30 July 2024  09:53:54 -0400 (0:00:00.026)       0:00:02.967 ********** 
fatal: [managed_node1]: FAILED! => {
    "changed": false,
    "failures": [
        "No package pcs available.",
        "No package corosync-qnetd available."
    ],
    "rc": 1,
    "results": []
}

MSG:

Failed to install some of the specified packages
  1. CentOS-Stream-8|ansible-2.9
TASK [fedora.linux_system_roles.ha_cluster : Install role essential packages] ***
task path: /tmp/tmp.LyaCTQJAFf/ansible_collections/fedora/linux_system_roles/roles/ha_cluster/tasks/main.yml:11
Tuesday 30 July 2024  09:53:52 -0400 (0:00:00.045)       0:00:04.269 ********** 
fatal: [managed_node1]: FAILED! => {
    "changed": false,
    "failures": [
        "No package pcs available.",
        "No package corosync-qnetd available."
    ],
    "rc": 1,
    "results": []
}

MSG:

Failed to install some of the specified packages

@richm
Copy link
Contributor

richm commented Jul 31, 2024

CentOS-Stream-8/ansible-2.17:

Yes, ignore this. ansible 2.17 does not support centos-8 managed nodes. We will be removing this test shortly.

CentOS-Stream-8|ansible-2.16

@spetrosi Looks like we need to enable the HA (and ResilientStorage) repos on centos e.g. something like what we do in tox-lsr - https://github.com/linux-system-roles/linux-system-roles.github.io/blob/main/download/linux-system-roles.json#L105

            { "name": "Enable HA repos",
              "command": "dnf config-manager --set-enabled ha resilientstorage"

Most of fails are because of passlib. We can deal with them in another pull request (maybe as suggested here #216 (comment)) and finish this pull request afterwards.

Yes, sounds good.

At any rate, none of the test failures are due to this PR.

@richm richm closed this Jul 31, 2024
@richm richm reopened this Jul 31, 2024
@spetrosi
Copy link
Collaborator

A pr with workaround that installs passlib for now is it linux-system-roles/tft-tests#13
Enabling ha is in place, I wonder if this PR wasn't rebased and run an older test plan. I'll now check in weekli ci

@spetrosi
Copy link
Collaborator

@idevat please rebase and I'll rerun the ci

@idevat
Copy link
Contributor Author

idevat commented Aug 1, 2024

@spetrosi rebased.

@tomjelinek
Copy link
Member

[citest]

@richm richm merged commit 4b79213 into linux-system-roles:main Aug 1, 2024
30 of 37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants