-
-
Notifications
You must be signed in to change notification settings - Fork 881
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
initial support for snippets #1231
Conversation
If we're going to add this in, we need to have a way where we can also ensure the snippets directory is We will also need tests and docs added for this functionality. |
Would you also need to notify the service for any new snippets added? This isn't a feature I've used from nginx before, so just asking. If yes, then you'll want to work that in before we pull this. |
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 get rid of all the ::nginx
and replace them with nginx
? We have another PR in to finally update all this throughout the rest of the module and I don't want to re-introduce them here.
Nevermind, you got it covered, i just missed it in my first read-through. |
Ok, so a recap of changes needed before we can pull:
|
86726fd
to
aa07f14
Compare
$name_sanitized = regsubst($name, ' ', '_', 'G') | ||
$config_file = "${nginx::snippets_dir}/${name_sanitized}.conf" | ||
|
||
concat { $config_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.
Probably need a check in here to ensure that $config_file
isn't already defined as a concat resource. If it is and you try to add another snippet to the same $config_file
, it will fail when it tries to create this resource.
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'm not sure about this. $config_file contains the name of the defined resource, so it's already unique in the catalog.
initial support for snippets
initial support for snippets
Pull Request (PR) description
Add basic support for creating snippets (reusable configuration files) that can be included by other resources. In phase 1 of this effort I am just introducing the ability to create include files by providing the raw contents, but future phases will include writing server::resource::location output into a snippet for reusability.
Please let me know your thoughts on the direction this is going.
This Pull Request (PR) fixes the following issues
Fixes #644
Fixes #1135