-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Kdump ansible integration #19430
Kdump ansible integration #19430
Conversation
@martinpitt @marusak please take a look, I'm leaning towards teaching pkg/kdump/config-client.js what the default is. Drafted a PR #19434 |
#19434 is still unclear to me, how it validates the actual default vs. the hardcoded one (it doesn't seem to do that at all). I would have thought it would take the default kdump.conf at the beginning of the test, parse the setting, and compare it to the changed one after clicking around. That would be acceptable to me.
In the sense of "if we don't find a |
It's not just with compression, if you removed the core_collector entry we set just |
fcc5dc3
to
ec3ece5
Compare
ec3ece5
to
657da11
Compare
1e940ef
to
94c6deb
Compare
636acb6
to
0da6d5d
Compare
TestKdump is flaky, and I forgot to exclude OStree so I will do that in a fixup. But Fedora-38/Fedora-39 at least passes so it's good enough to review. |
0da6d5d
to
bb8994f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Initial review. Note that we should test the shell script as well. Thanks!
We do that in TestKdump.testBasic. Maybe that is confusing? |
Leftover issues:
|
@martinpitt do you have an idea what this might be?
The related code is, so
|
a83d5dc
to
f713bf1
Compare
Debugged, squashed and re-pushed. Everything should go green now, code just needs a closer look :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! More in-depth review.
169a6c2
to
5182da9
Compare
5182da9
to
dee7084
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Note that there are still two threads from the previous review which are current.
} else if (target === "nfs") { | ||
ansible += ` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, weird -- why wouldn't this be covered by TestKdumpNFSAnsible
?
dee7084
to
d704728
Compare
if (os_release.NAME === "RHEL" || os_release.ID_LIKE?.includes('rhel')) { | ||
role_name = "rhel-system-roles"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's legit, we only do coverage on Fedora.
pkg/kdump/kdump-view.jsx
Outdated
if (target === "ssh") { | ||
let ssh_user; | ||
if (targetSettings.server.includes('@')) { | ||
ssh_user = targetSettings.server.split('@')[0]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is weird -- we currently have a test case which exercises "admin@ip"..
if (targetSettings.server.includes('@')) { | ||
ssh_user = targetSettings.server.split('@')[0]; | ||
} else { | ||
ssh_user = "root"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's the missing test case (see the other thread)
pkg/kdump/kdump-view.jsx
Outdated
`; | ||
} else if (target !== "local") { | ||
// target is unsupported | ||
throw new Error("Unsupported kdump target"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add a // not-covered: assertion
, it's not meant to be reached.
d704728
to
3d0f3d5
Compare
Extend the kdump page to allow administrators to configure kdump via Cockpit and export an Ansible playbook using the linux-system-roles kdump role.
3d0f3d5
to
864d376
Compare
include_role: | ||
name: ${role_name}.kdump | ||
vars: | ||
kdump_path: ${targetSettings.path || DEFAULT_KDUMP_PATH} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This added line is not executed by any test. Details
kdump_path: ${targetSettings.path || DEFAULT_KDUMP_PATH} | ||
kdump_core_collector: ${kdump_core_collector}`; | ||
|
||
if (target === "ssh") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This added line is not executed by any test. Details
let ssh_user; | ||
let ssh_server; | ||
const parts = targetSettings.server.split('@'); | ||
if (parts.length === 1) { | ||
ssh_user = "root"; | ||
ssh_server = parts[0]; | ||
} else if (parts.length === 2) { | ||
ssh_user = parts[0]; | ||
ssh_server = parts[1]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These 9 added lines are not executed by any test. Details
ssh_user = parts[0]; | ||
ssh_server = parts[1]; | ||
} else { | ||
throw new Error("ssh server contains two @ symbols"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This added line is not executed by any test. Details
} else { | ||
throw new Error("ssh server contains two @ symbols"); | ||
} | ||
ansible += ` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This added line is not executed by any test. Details
kdump_sshkey: ${targetSettings.sshkey} | ||
kdump_ssh_server: ${ssh_server} | ||
kdump_ssh_user: ${ssh_user}`; | ||
} else if (target === "nfs") { | ||
ansible += ` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These 5 added lines are not executed by any test. Details
ansible += ` | ||
kdump_target: | ||
type: nfs | ||
location: ${targetSettings.server}:${targetSettings.export} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This added line is not executed by any test. Details
type: nfs | ||
location: ${targetSettings.server}:${targetSettings.export} | ||
`; | ||
} else if (target !== "local") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This added line is not executed by any test. Details
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, enough bickering! There's that outdated comment, but it doesn't hurt much. If you want to update again because of that, I'm happy to re-approve.
I added a release-note label. Can you please massage the description and screenshot accordingly? Thanks!
// HACK: we should not have to specify kdump_ssh_user and kdump_ssh_user as it is in kdump_target.location | ||
// https://github.com/linux-system-roles/kdump/issues/184 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment is outdated now, as we don't actually specify .location
any more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I need to do a follow up anyway for self.createPackage, so I'll add it there.
This introduces the ability to generate an Ansible playbook from the curent kdump configuration.
The new
view automation script
button:The role:
Overall the functionality is quite easy to implement except for one issue. Adding compression support, as the kdump role has no special flag indication that one wants compression we have to set a
kdump_corecollector
. By default acorecollector
is set so we can use that. If for some reason it is absent, we have to make up what it should be which I find non-ideal.When
/etc/kdump.conf
does not containcore_collector
when adding compression we setmakedumpfile -c
, however if we then disable compression we generate an invalid configuration:Related is, that once one start's messing with
core_collector
settings you no longer get anything representing the default. Also note that the defaultcore_collector
according to the man page should be (RHEL-8-10):Which the ansible role does not adhere too. So us setting
kdump_corecollector
is a good thing. However when it is absent due to an Administrator the handling is suboptimal.I see two options:
Kdump: Add Ansible/shell automation
The Kdump page can generate an Ansible role or a shell script for replicating the current kdump configuration to other machines.