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

Add install_options for RedHat Family in sensors plugin #664

Closed

Conversation

ziporah
Copy link

@ziporah ziporah commented Apr 19, 2017

This patch adds the global specified installation options for the sensors plugin

) {

include ::collectd

$_manage_package = pick($manage_package, $::collectd::manage_package)

if $package_install_options != undef {
validate_array($package_install_options)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of this validation block, could you update package_install_options in the params.pp so it is an optional array?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I copied the code from the apache.pp file, for all occurances. Is there any plan on you guys refactoring the entire code ? Actually none of the RedHat occurences uses the correct options.
Will see what and how I can fix this.

Copy link
Author

@ziporah ziporah Apr 19, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is best practice to define the array with all arguments. You don't know the amount of options used however.
Optional[Array[String[]]] $package_install_options = undef
will allow only any number of elements in the array.
@bastelfreak Can you please advise if this is your prefered choice ?It does not seem to be the way to go according to several sources.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should work:

Optional[Array[String]] $package_install_options = undef

our time is limited, we will refactore the whole code somewhere in the future. We would like to already use the new datatypes for all new pull requests.

if $::osfamily == 'Redhat' {
if $_manage_package {
package { 'collectd-sensors':
ensure => $ensure,
ensure => $ensure,
install_options => $package_install_options,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you add spec tests for this?

@bastelfreak
Copy link
Member

Hey @ziporah, thanks for your contribution!

Can you please take a look at the used email address in your commit? It isn't asociated with your github account. Can you please add the address or change it?

@bastelfreak
Copy link
Member

Puppet 4 introduced nice datatypes, this allows us to get rid of all the validate_* functions. They are now deprecated. Can you replace the validate call with the proper datatype? Feel free to join our IRC channel #voxpupuli on freenode if you've any questions. We're almost 24/7 reachable.

@bastelfreak
Copy link
Member

Ping @ziporah

@ziporah
Copy link
Author

ziporah commented Jul 20, 2017

sorry, have been busy with some major upgrades. I'm trying to pick this up again in august

@wyardley
Copy link
Contributor

@ziporah do you still want to rework this?
It looks like it will need a rebase now also.

@ziporah
Copy link
Author

ziporah commented Sep 15, 2017 via email

@bastelfreak
Copy link
Member

HI @ziporah, are you still interested in this? Otherwise we're going to close this next month.

@ziporah
Copy link
Author

ziporah commented Mar 19, 2018

Hey @bastelfreak my collegue will create a new PR this week that should work as per your request. I'm currently to busy.

@bastelfreak
Copy link
Member

I'm going to close this since we merged #762

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

Successfully merging this pull request may close these issues.

3 participants