diff --git a/pkg/converter/tmpl/template.go b/pkg/converter/tmpl/template.go index a1241776..1fdeb5a7 100644 --- a/pkg/converter/tmpl/template.go +++ b/pkg/converter/tmpl/template.go @@ -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) diff --git a/pkg/executor/pipeline_executor.go b/pkg/executor/pipeline_executor.go index dd7fdb98..c66878e5 100644 --- a/pkg/executor/pipeline_executor.go +++ b/pkg/executor/pipeline_executor.go @@ -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) }