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

Option for create nfs exported directory #186

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bschonec
Copy link
Contributor

I have a case where an application I'm installing expects that the folders to be exported via NFS do NOT exist at application install time.

This PR allows for the edge case where you don't want to create the directories but you do want to manage the NFS export file(s).

@tuxmea
Copy link
Member

tuxmea commented Jun 10, 2024

@bschonec Can you please rebase your branch?

@bschonec bschonec force-pushed the option_for_create_nfs_exported_directory branch from b2e91e8 to a164ebe Compare June 10, 2024 12:09
@bschonec
Copy link
Contributor Author

@Tux, sure thing. I'm not sure where I should put the tests for the directory (not) creation. There are a lot of places in the tests where it does "ensure directory." I only need to test for "not ensure directory." Should I just create a simple nfsv4/nfsv3 section and do a "not ensure directory" and not test for anything else?

mode => $mode,
selinux_ignore_defaults => true,
if $create_dir {
filepath { $name:
Copy link
Member

Choose a reason for hiding this comment

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

Why the switch of file into filepath? That's not relevant when it comes to creating the folder or not and there is another PR for this change.

I would argue that this module almost never should create this folder as that normally is the responsibility of another module. I think it would be even worse to let it create an entire path ...

It would be a breaking change, but I would consider setting $create_dir default to false.

Copy link
Member

Choose a reason for hiding this comment

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

Please stay with file for now. Besides this: there are two implementations for creating recursive directories: filepath and dirtrtee. We should have this change in a separate PR so we can check and review which module is the better one to use.

Copy link
Member

Choose a reason for hiding this comment

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

@bschonec bschonec force-pushed the option_for_create_nfs_exported_directory branch 3 times, most recently from 1a9fa3c to 79e32d1 Compare June 10, 2024 12:55
@@ -57,7 +57,9 @@
# @param v4_export_name
# @param nfsv4_bindmount_enable
#
# @examples
Copy link
Member

Choose a reason for hiding this comment

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

please re-add the @examples strings tag.

Copy link
Contributor Author

@bschonec bschonec Jun 11, 2024

Choose a reason for hiding this comment

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

Done. (I think). @tuxmea, can you explain or point me to an explanation of what @examples does?

Copy link
Member

@h-haaks h-haaks Jun 11, 2024

Choose a reason for hiding this comment

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

I think it should be @example, and it's is a tag used by puppet strings to render an example in REFERENCE.md
See https://www.puppet.com/docs/puppet/8/puppet_strings.html

It should be moved below the last @param at line 65

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should I create a separate pull request of off the current master to fix @examples/@example?

If so, #193

Copy link
Member

@tuxmea tuxmea Jun 12, 2024

Choose a reason for hiding this comment

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

No need to have another PR. please fix it here and please keep in mind that the code example must be indented by 2 spaces.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've fixed it here but I have no idea what you're referring to when you say, "...code example must be indented by 2 spaces."

Copy link
Member

Choose a reason for hiding this comment

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

@bschonec the example should have a description, then the example code. The code should be indented two spaces, so there should be three spaces after the hash mark #. Examples: https://github.com/search?q=repo%3Avoxpupuli%2Fpuppet-systemd%20%40example&type=code

Copy link
Member

Choose a reason for hiding this comment

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

Tag was readded. This is OK for me. We can solve this conversation.

@bschonec bschonec force-pushed the option_for_create_nfs_exported_directory branch 2 times, most recently from b3a02f8 to 6e9b743 Compare June 12, 2024 17:21
@bschonec bschonec force-pushed the option_for_create_nfs_exported_directory branch from 6e9b743 to bcf5d29 Compare June 13, 2024 11:17
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.

None yet

4 participants