Skip to content

Problem: Template's CLI arg still applied, despite removed when running Task #3734

@agrrh

Description

@agrrh

Issue

Hello!

Scenario:

  • Create Task Template
  • Set --check as default CLI arg (kind of safeguard)
  • Set "Prompt CLI args" to let operator remove safeguard explicitly
  • Run Task, not removing --check arg
  • Run Task, removing --check arg

Expected behavior:

  • First task runs in check mode
  • Second task applied

Actual behavior:

  • First task runs in check mode
  • Second task runs in check mode, too!

My guess is that "Task args" ([]) are just merged with "Template args" (["--check"]):
https://github.com/semaphoreui/semaphore/blob/v2.17.28/services/tasks/LocalJob.go#L252

This logic leads to --check ending up in actual Ansible call ...

Ideas:

  • "Task args" may override "Template args" setting, if not equal
  • "Template args" should be excluded, if operator had removed those from "Task args"

Impact

Web-Backend (APIs), Web-Frontend (what users interact with), Ansible (task execution)

Installation method

Docker

Database

Postgres

Browser

Firefox

Semaphore Version

semaphore-v2.17.28

Ansible Version

Logs & errors

No response

Manual installation - system information

No response

Configuration

No response

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No fields configured for Task.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions