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 user/group/mode parameter to custom types #129

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

trefzer
Copy link
Contributor

@trefzer trefzer commented Jul 5, 2021

This adds the possibility to directly specify user/group and mode for key, request, cert and dh.
In a second step the manifests could be simplified (no need for file resources setting permissions).

lib/puppet/provider/dhparam/openssl.rb Outdated Show resolved Hide resolved
lib/puppet/provider/openssl.rb Outdated Show resolved Hide resolved
@trefzer trefzer force-pushed the dev_add_permissions branch 2 times, most recently from a2fe174 to b4d8368 Compare July 5, 2021 11:21
Copy link
Member

@ghoneycutt ghoneycutt left a comment

Choose a reason for hiding this comment

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

This adds conditional logic with regards to the regex's. Because of this the spec tests should test that invalid data triggers the errors as expected.

newproperty(:mode) do
desc 'mode of the file'
validate do |value|
unless value =~ %r{^0\d\d\d$}
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 test against stdlib's filemode type which has testing instead of this regex which does not really cover valid modes?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can you give me any further hints what you mean ? I also have no idea how to use Stlib::Filemode type for this property. As far as I can see, if Stdlib::Filemode is used, we need some more logic to adapt for the setter/getter to work.

Copy link
Member

Choose a reason for hiding this comment

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

I don't think you can use type aliases in types (yes, that's confusing; naming is hard).

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

Successfully merging this pull request may close these issues.

3 participants