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 #1284

Closed
wants to merge 1 commit into from

Conversation

nabertrand
Copy link
Contributor

Summary

This adds support for having executable templates as described in #1224.

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.

No spec or acceptance tests have been added and no documentation has been updated because I wanted to wait for consensus on this approach before spending time on testing or documentation.

Related Issues (if any)

#1224

Checklist

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

@nabertrand nabertrand requested a review from a team as a code owner November 2, 2023 21:52
@nabertrand nabertrand force-pushed the executable_templates branch 2 times, most recently from 62502f2 to 30a105a Compare November 3, 2023 15:38
@nabertrand nabertrand mentioned this pull request Nov 16, 2023
3 tasks
@nabertrand
Copy link
Contributor Author

@jordanbreen28 as discussed in Slack, I've added spec tests in #1289. There's also a related documentation update in puppetlabs/pdk-templates#539

@nabertrand
Copy link
Contributor Author

Closing in favor of #1289

@nabertrand nabertrand closed this Jan 8, 2024
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