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

Adding options to configure dir and file modes + tests #868

Closed
wants to merge 2 commits into from
Closed

Adding options to configure dir and file modes + tests #868

wants to merge 2 commits into from

Conversation

jplindquist
Copy link
Contributor

Pull Request Checklist

Adds 2 new options to manage config directory and file permissions

Description

Adds 2 new options (config_dir_mode and config_file_mode) to enable management of directory and file permissions. Both options are optional and default to their existing settings depending on OS (Windows / other). If the new settings are undefined, there should be net zero changes to existing configs.

Related Issue

Closes #825

Motivation and Context

Allow users to explicitly manage their own directory and file permissions to line up with other types of management systems where applicable (i.e. rpm packages)

How Has This Been Tested?

Ran spec tests before and after code changes, net zero changes unless config settings are present. Added new tests to verify settings when options are set.

General

  • Update README.md with any necessary configuration snippets

  • New parameters are documented

  • New parameters have tests

  • Tests pass - bundle exec rake validate lint spec

@@ -347,6 +353,14 @@
Boolean $manage_mutators_dir = true,
Optional[String] $sensu_user = undef,
Optional[String] $sensu_group = undef,
Optional[String] $config_dir_mode = $::osfamily ? {
Copy link
Collaborator

Choose a reason for hiding this comment

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

These should be Optional[Stdlib::Filemode].

@ghoneycutt
Copy link
Collaborator

PR looks great! Thank you!

I added Stdlib::Filemode not long ago and transitioned the module to use it, so these should use that new type.

https://github.com/puppetlabs/puppetlabs-stdlib/#stdlibfilemode

@ghoneycutt ghoneycutt self-assigned this Jan 16, 2018
@jplindquist
Copy link
Contributor Author

Awesome, thanks for the quick feedback @ghoneycutt. Updated types to Stdlib::Filemode

@ghoneycutt
Copy link
Collaborator

Thanks @jplindquist

I'm closing this in favor of #869 where I just rebased your commits.

@ghoneycutt ghoneycutt closed this Jan 16, 2018
@ghoneycutt
Copy link
Collaborator

Released in v2.49.0

@jplindquist jplindquist deleted the ISSUE-825 branch January 16, 2018 16:28
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