Skip to content

Node attributes are not substituted in adhoc commands #552

@leonboot

Description

@leonboot

I would expect to be able to use node and/or job attributes in ad hoc commands, just like in regular job scripts (like @node.name@, @job.project@, or @node.some_custom_attribute@) but it seems this is not supported, or I haven't found the proper notation.

I have tried the following command on a project that has two nodes, both having an attribute called stage:

 rd adhoc --follow --project=my-project --filter='stage: .*' -- echo @node.stage@

This results in the following output:

# Started execution 974785 running 2024-06-18T09:45:20+0200 - https://my-rundeck-server/project/my-project/execution/show/99999 adhoc echo @node.stage@
@node.stage@
@node.stage@

Wrapping the command in single or double quots made no difference, nor did omitting the --.

I noticed an --interpreter flag, but its description, Script interpreter string, doesn't make it clear to me what its purpose is and if this might be the key to getting the attribute substition to work.

Is attribute substition actually supported for ad hoc commands? And if so, could this be added to the documentation?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions