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
- Added Puppet 4 types for all parameters. #11
Conversation
rehanone
commented
May 5, 2018
- Added Puppet 4 types for all parameters.
- Converted the module to use Puppet Development Kit.
- Fixed style errors.
- Fixed naming errors.
- Updated minimum puppet and dependencies versions and dropped unsupported versions.
manifests/init.pp
Outdated
Optional[String] $service_restart = $autofs::params::service_restart, | ||
Hash $mapfiles = lookup('autofs::mapfiles', Hash, 'hash', {}), | ||
Hash $mounts = lookup('autofs::mounts', Hash, 'hash', {}), | ||
Hash $includes = lookup('autofs::includes', Hash, 'hash', {}), |
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.
Puppet provides an automatic hiera lookup for all class parameters. This isn't necessary
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.
Can you review it?
$order = undef | ||
# | ||
define autofs::include ( | ||
String $mapfile = $title, |
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.
Why do you prefer title instead name?
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 was using this as a reference https://puppet.com/docs/puppet/5.5/lang_defined_types.html#title-and-name
But I think name is also good and I can revert it.
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.
Ah, nice to know.
Since mapfile should be unique, $title is better then name.
manifests/init.pp
Outdated
$map_config_dir = $autofs::params::map_config_dir, | ||
Boolean $package_manage = $autofs::params::package_manage, | ||
Array[String] $package_name = $autofs::params::package_name, | ||
Enum[present, absent, purged, installed] |
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.
String should be good enough, because ensure allows to define a specific version.
manifests/init.pp
Outdated
Boolean $service_hasrestart = $autofs::params::service_hasrestart, | ||
Boolean $service_hasstatus = $autofs::params::service_hasstatus, | ||
Enum[running, stopped] | ||
$service_ensure = $autofs::params::service_ensure, |
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.
True and False are also allowed. https://puppet.com/docs/puppet/5.4/types/service.html#service-attribute-ensure
define autofs::mapfile ( | ||
Optional[Stdlib::Absolutepath] $directory, | ||
Enum[present, absent, purged] $ensure = present, | ||
String $mapfile = $title, |
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.
Why $title instead $name?
manifests/mapfile.pp
Outdated
Optional[String] $options = undef, | ||
Optional[String] $order = undef, | ||
Enum[ file, program, yp, nisplus, hesiod, ldap, ldaps] | ||
$maptype = file, |
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.
No string quotas anymore required?
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.
3172471
to
346cad8
Compare
- Added `rspec-puppet-facts` to run tests on all supported os versions. - Updated puppet and dependency versions for the module.
346cad8
to
7066684
Compare
@jkroepke Can you please check now. |
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.
Bare words looks still scary but it should be okay.