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

Support executable templates #1289

Merged

Conversation

nabertrand
Copy link
Contributor

Summary

This adds support for having executable templates as described in #1224. This is a duplicate of #1284 with spec tests added.

Additional Context

This PR makes use of a new manage_execute_permissions boolean config setting, which can be set on an individual template or enabled globally in the common config key. The existing code relied on a :global config setting:

file_config = @config.fetch(:global, {})

But as far as I can tell that key is no longer valid as neither the Symbol class nor the :global symbol are allowed during YAML parsing:
YAML.safe_load(PDK::Util::Filesystem.read_file(loc), permitted_classes: [], permitted_symbols: [], aliases: true)

I noticed the current config_defaults file contains a common key, so I thought we could reuse that here.

Related Issues (if any)

#1224

Checklist

  • 🟢 Spec tests.
  • 🟢 Acceptance tests.
  • Manually verified.

@nabertrand
Copy link
Contributor Author

Documentation update in puppetlabs/pdk-templates#539

@nabertrand nabertrand mentioned this pull request Nov 16, 2023
3 tasks
Copy link
Contributor

@jordanbreen28 jordanbreen28 left a comment

Choose a reason for hiding this comment

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

Spot on @nabertrand!

@nabertrand
Copy link
Contributor Author

@jordanbreen28 hoping this and puppetlabs/pdk-templates#539 can still get merged before the next PDK release. Let me know if there's anything I can do to help get them merged.

Copy link
Contributor

@jordanbreen28 jordanbreen28 left a comment

Choose a reason for hiding this comment

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

Thanks for the ping @nabertrand - great job on this and thanks for the contribution!

@jordanbreen28 jordanbreen28 merged commit 4270a2d into puppetlabs:main Jan 8, 2024
11 checks passed
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