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

(PDK-1269) Add plan template #184

Merged
merged 2 commits into from
Feb 15, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions object_templates/plan.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#
# Puppet Plan Name: <%= name %>
#
# This is where you put the puppet code for your plan.
#
# You can write Puppet Plans in puppet code
#
# Learn more at: https://puppet.com/docs/bolt/1.x/writing_plans.html

plan <%= name %> (
String[1] $parameter1,
TargetSpec $parameter2,
) {

run_task('modulename::task_name', $parameter1, some_parameter_name => $parameter2)
Copy link
Contributor

Choose a reason for hiding this comment

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

I'll have to check if we pass in the module name to the config hash, would be nice to fill in the modulename::task_name part.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is just some made up boiler plate of how someone would put a task in a plan. However, up on line 10 it only passes though the name of the plan but without namespacing and we really have to fix that.

https://github.com/puppetlabs/pdk-templates/pull/184/files#diff-41c11f3567ed263cffeae409027787f8R10

I think what the template for a plan should look like is something I'd want the bolt maintainers to provide. Since it can run tasks, scripts, commands, puppet apply there's no one size fits all template but I think we want to get a small snippet of each ideally so the user can copy /paste.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yep, I agree. I'll merge this to get something boilerplate in, and we can address more codified templates of plans, tasks, and tests with the Bolt team.

}
2 changes: 1 addition & 1 deletion object_templates/task.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh

# Puppet Task Name: <% task_name %>
# Puppet Task Name: <%= name %>
#
# This is where you put the shell code for your task.
#
Expand Down