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

set group of fragments to gid #230

Merged
merged 1 commit into from
Mar 2, 2015

Conversation

duritong
Copy link
Contributor

gid has now been part of facter for a long time, it is safe to use
it now.

@sathieu
Copy link
Contributor

sathieu commented Feb 10, 2015

any new on this PR?

@jhoblitt
Copy link
Contributor

I'm hesitant to assume $::gid is universally present but setting an internal constraint on $::facterversion seems like a lot of complexity for little net functionality.

@hunner Is there a [planned] way to place a dependency on the facter version via metadata.json?

Also, since this PR modifies the public API the README documentation would need to be updated.

@duritong
Copy link
Contributor Author

I had a quick look at the README and so far only API deprecations are documented. This change doesn't deprecate anything it adds a new feature. If you tell me where you like to have changes like this document, I can adapt the PR

@duritong
Copy link
Contributor Author

btw: I rebased it into current master

@underscorgan
Copy link
Contributor

Hi @duritong,

Thanks for the contribution! It looks like there aren't actually any docs updates needed since you didn't add any parameters that are exposed through a class/defined type.

This fact was added in facter 2.2, so I think we still need to account for it not being present. Could you wrap the new parameter in something like this and explicitly set $fragment_group to undef if the fact isn't defined?

Thanks!

gid has now been part of facter for a long time, it is safe to use
it now.
@duritong
Copy link
Contributor Author

duritong commented Mar 1, 2015

I updated my pull request as discussed

underscorgan pushed a commit that referenced this pull request Mar 2, 2015
@underscorgan underscorgan merged commit a3d8632 into puppetlabs:master Mar 2, 2015
@underscorgan
Copy link
Contributor

great, thanks @duritong !

@jhoblitt
Copy link
Contributor

jhoblitt commented Mar 3, 2015

uh, this PR changes the public API...

@duritong
Copy link
Contributor Author

duritong commented Mar 4, 2015

@jhoblitt I specifically asked you where to document it and later @mhaskel agreed with me that we didn't add a new parameter.

So if you want me to document that change, you must be more specific and verbose of what should be added. Thanks.

@underscorgan
Copy link
Contributor

@jhoblitt this only adds in-class variables, no new parameters.

@jhoblitt
Copy link
Contributor

jhoblitt commented Mar 4, 2015

Ignore me -- my case of the flu has been talking. This is 👍

@underscorgan
Copy link
Contributor

feel better!

@duritong duritong deleted the set_group_for_fragments branch March 5, 2015 14:53
@sodabrew
Copy link

Hi, this means I need Facter 2.0 or higher on all nodes. What's the purpose of this functionality in the first place? I never want the ownership of the concatfragments.sh to be anything other than root.

Edit: oh, I didn't notice this in setup.pp, thanks for including support for older facter! I still don't understand the reason for other ownership though.

  # test on gid fact availability to support older facter versions
  if defined('$gid') ...

@duritong
Copy link
Contributor Author

It just brings everything in line. Owner and mode are already managed, so why not group?

Additionally, if you don't manage the group, group ownership is in kind of a limbo state, as it's not sure that the group will really be root. Especially, if you copy fragments from a source.
And as you might see from the deprecation messages, you can't actually set the owner, group nor mode it has no effect:

if $mode {
warning('The $mode parameter to concat::fragment is deprecated and has no effect')
}
if $owner {
warning('The $owner parameter to concat::fragment is deprecated and has no effect')
}
if $group {
warning('The $group parameter to concat::fragment is deprecated and has no effect')
}

And last but not least: We can't hardcode it to root, because this would make the concat module unusable if you run puppet as a unprivileged user. There are tons of valid use cases for that and there is no reason that the concat module requires root to be used.

@sodabrew
Copy link

Thanks for the explanation. Looks like it's doing the right thing for me since #280 as a fallback for not having the gid fact on my older nodes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants