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

fix some bug when using playbook #2427

Merged
merged 1 commit into from
Oct 10, 2024
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
2 changes: 1 addition & 1 deletion pkg/converter/tmpl/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func ParseBool(ctx map[string]any, inputs []string) (bool, error) {
// ParseString parse template string to actual string
func ParseString(ctx map[string]any, input string) (string, error) {
if !IsTmplSyntax(input) {
return input, nil
return strings.Trim(input, "\r\n"), nil
}

tl, err := internal.Template.Parse(input)
Expand Down
4 changes: 4 additions & 0 deletions pkg/executor/pipeline_executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,10 @@ func (e pipelineExecutor) execBatchHosts(ctx context.Context, play kkprojectv1.P
}
// generate task from role
for _, role := range play.Roles {
if !role.Taggable.IsEnabled(e.pipeline.Spec.Tags, e.pipeline.Spec.SkipTags) {
// if not match the tags. skip
continue
}
if err := e.variable.Merge(variable.MergeRuntimeVariable(role.Vars, serials...)); err != nil {
return fmt.Errorf("merge variable error: %w", err)
}
Expand Down
Loading