#400 new
Marcello de Sousa

Custom Fields can't be used in a filter

Reported by Marcello de Sousa | July 22nd, 2011 @ 07:45 AM

Since 1.3 you are able to generate custom fields on the fly based on the input from your resource provider. These fields are shown in the UI but are not usable to create a filter.
According to Alex-SF (via IRC) this is an oversight and should be implemented.

Comments and changes to this ticket

  • Alex-SF

    Alex-SF July 22nd, 2011 @ 08:12 AM

    Some custom fields might also be a list (like tags). Perhaps Rundeck can interpret them if they are unquoted lists. Eg in yaml form,

    • this is a list:
      • classes: apache,nginix
    • this is a string:
      • classes: "apache,nginix"

    Allowing a custom field to be interpreted as a list will facilitate tags-like filtering. Eg

    • Include nodes that have a class of either apache or nginix
      • `` -I classes=apache,nginx
    • Include nodes that have a class nginix and a role web
      • -I classes=nginix -I role=web
  • stagr.lee

    stagr.lee February 16th, 2012 @ 04:00 PM

    Is this partially implemented? Seems to work on command line "dispatch -p myproj -I environment=prod" but not form rundeck web.

  • Greg Schueler

    Greg Schueler February 16th, 2012 @ 04:13 PM

    The GUI simply doesn't support filtering by custom attributes yet. This is
    supported in the underlying filter code, and the CLI tools. it needs to be
    added to the GUI

  • Etienne Pelletier

    Etienne Pelletier February 16th, 2012 @ 04:38 PM

    What about in the XML job description too? I really want to be able to specify a dynamic node filter using the custom attributes. That way I can define something like environment="production" in my node definition, and use a job option to specify the environment dynamically.

    This will give me the possibility of making the option required. That way I don't dispatch commands to ALL environment by accident if the "environment" option wasn't specified.

    Here's an example of what I'm talking about:

    ...

      <include>
        <tags>web</tags>
        <env>${option}</env>
      </include>
    </nodefilters>
    

    ...

  • Etienne Pelletier

    Etienne Pelletier February 16th, 2012 @ 04:38 PM

    That should have been ${option.env} btw.

  • Greg Schueler

    Greg Schueler February 16th, 2012 @ 05:44 PM

    Yes, needs to be supported in the xml/yaml serialization formats as well too

  • Phil Spencer

    Phil Spencer February 29th, 2012 @ 08:27 AM

    Am also interested in this!
    I am trying to get some puppet facts (facter -p) into rundeck.
    I am using puppet-rundeck, to include those facts

    But rundeck isn't picking those fields up in the include/exclude filters

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

(DEPRECATED) Please use github issues for issue tracking at http://github.com/dtolabs/rundeck/issues

Shared Ticket Bins

Pages