-
-
Notifications
You must be signed in to change notification settings - Fork 881
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
Update params to account for oracle linux. #183
Update params to account for oracle linux. #183
Conversation
This will break Gentoo users using older Facter (pre 1.7) releases, where Should either add Linux to the selector or refactor to be a case statement with a default that returns "nginx" as the user. |
This is great, but I'd rather run in parallel with a deprecation warning if |
Maybe something like this? if $::osfamily {
# case osfamily and warn if == linux but set to nginx
} else {
# set nx_daemon_user based on $::operatingsystem
# jam oraclelinux in regex like #177?
} |
@drfeelngood yeah, that looks good. I'd also add a |
@jfryman Does this correspond to what you're envisioning? |
/(?i-mx:fedora|rhel|redhat|centos|scientific|suse|opensuse|amazon|gentoo)/ => 'nginx', | ||
if $::osfamily { | ||
$nx_daemon_user = $::osfamily ? { | ||
/(?i-mx:redhat|suse|gentoo)/ => 'nginx', |
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.
Add "linux" to the strings to match to avoid a regression (so Gentoo users on Facter versions >= 1.6.2 and < 1.7 still work). In these versions on Gentoo osfamily = "Linux" so the if
expression is true, but the selector won't match anything.
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.
Argh, I had it then second guessed myself. All is well now.
I'm confused about the warning - what's the user being warned about? If they upgrade Facter (to the current version, or 2.0 when it comes out) things will just keep on working if this is merged. If the warning is because this module now deprecates |
I guess with the current state of this code the warning might not be necessary from what you said. I don't think I'm the person to say "it's going to be deprecated", so possibly leaving it out for now makes the most sense. What do you think? |
Oh I'm not sure either, that's @jfryman's call. Just not a fan of warnings that don't indicate what action is needed. Oh and side note, I'm glad you fixed that warning for lsbmajdistrelease in code. I'm working on rspec tests for this module and keep having to define that fact (after always having failures because I forgot to do so), so I hope this is merged! |
We can be more explicit in the warning, but the intent is that in a few releases of something, I'm yanking this out. I really hate to keep edge cases in the code, so I'd rather let the user know it'll be soon to update. But yes, the warning should be when I'm open to suggestion on how we communicate this to the user, but this needs to be here if we include this edge case so we don't accrue too much debt. |
How about something similar to the message found here warning('$::osfamily not defined. Support for $::operatingsystem is deprecated')
warning("Please upgrade from factor ${::facterversion} to >= 1.7.2") |
We should analyze the $::osfamily fact to define $nx_daemon_user. Support for $::operatingsystem remains but is greeted with a deprecation warning that suggests upgrading to factor >= 1.7.2. Corrected spec failures in redhat.pp when evaluating an undef $::lsbmajdistrelease. Now the variable must be defined before comparison.
I went ahead and squashed my commits to clean things up. |
👍 |
Love it! Thanks so much! ❤️ |
Update params to account for oracle linux.
…oracle_linux Update params to account for oracle linux.
Check $::osfamily when setting nx_daemon_user. See issues #176 and #177