-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Update init.rb to support Nvidia's Cumulus Linux #9453
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
Open
dpkgbofh
wants to merge
1
commit into
puppetlabs:main
Choose a base branch
from
dpkgbofh:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
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.
We already set
systemdas the default provider inpuppet/lib/puppet/provider/service/systemd.rb
Line 33 in dc0e3ba
init? Is theos.nameincorrect in the systemd provider?Uh oh!
There was an error while loading. Please reload this page.
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 what is what facter returns on Cumulus:
The exclusion solution was suggested somewhere on serverfault and is working for me.
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.
The pattern we've been following is to specify
systemdas the default for a given platform and then exclude older versions in situations where the platform usesinitor something else. For example, we do this fordebianpuppet/lib/puppet/provider/service/systemd.rb
Lines 27 to 28 in dc0e3ba
This way it's future compatible (so long as
systemdremains the default) and in theory it helps when documenting which providers are enabled by default on each platform. If we just exclude Cumulus frominit, it's not clear what provider is "next" precedence-wise.I think the root issue is this line is expecting the
os.namefact to returncumuluslinux(case-insensitively)puppet/lib/puppet/provider/service/systemd.rb
Line 33 in dc0e3ba
Maybe it did that in previous versions of Cumulus? Or maybe facter 4 is reporting the
os.namefact differently on Cumulus? What is the output offacter os? Could you try installing puppet-agent 6 on Cumulus and see whatfacter osreports?Related commits
15ed9d1
686d5ca
7ba4df5
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.
root@edd-sw30:~# puppet --version
7.23.0
root@edd-sw30:~# facter os
{
architecture => "amd64",
distro => {
codename => "cumulus",
description => "Cumulus Linux",
id => "Cumulus-linux",
release => {
full => "12.5",
major => "12",
minor => "5"
}
},
family => "Debian",
hardware => "x86_64",
name => "Cumulus",
release => {
full => "12.5",
major => "12",
minor => "5"
},
selinux => {
enabled => false
}
}
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, the root cause is because facter 3 used to report
os.name => "CumulusLinux"So
systemdwould be selected as the default due topuppet/lib/puppet/provider/service/systemd.rb
Line 33 in dc0e3ba
However, facter 4 reports
os.name => "Cumulus", hence this issue. To ensure compatibility with facter 3 and 4, could you add the following to thesystemdprovider:I'm assuming cumulus 3 and 4 are EOL?
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 Josh,
agreed!
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.
@dpkgbofh I unresolved this based on my comment:
At which point, I don't think the change to the
initprovider is needed?