'Rundeck filter for selecting a default value

Is there any way to select one default value from ten host name. For example I have tagged ten hosts. In my filter I want these 10 hosts but default when I execute only one will be selected.

  • host1 --> by default this should be mark as ticked when I execute and others should be there but not marked
  • host2
  • host3
  • host4


Solution 1:[1]

Yes, it´s possible, also I made a job definition example to test it.

- defaultTab: nodes
  description: ''
  executionEnabled: true
  id: 37179ac6-9b7d-403d-8d31-f260ad9b5928
  loglevel: INFO
  name: DefaultOptionDemo
  nodeFilterEditable: false
  nodefilters:
    dispatch:
      excludePrecedence: true
      keepgoing: false
      rankOrder: ascending
      successOnEmptyNodeFilter: false
      threadcount: '1'
    filter: ${option.mynode}
  nodesSelectedByDefault: true
  options:
  - enforced: true
    name: mynode
    value: node01
    values:
    - node00
    - node01
    - node02
    valuesListDelimiter: ','
  plugins:
    ExecutionLifecycle: null
  scheduleEnabled: true
  sequence:
    commands:
    - exec: whoami
    keepgoing: false
    strategy: node-first
  uuid: 37179ac6-9b7d-403d-8d31-f260ad9b5928
  1. Create a job, give it a name, and go to the Workflow tab.
  2. Add a new option a give it a name (mynode in the example).
  3. On the "Allowed values" section put the list of available hosts separated by commas e.g: node00,node01,node01. Look.
  4. Put your default value in the "Default value" section e.g: node01. Take a look.
  5. Select "Enforced from Allowed Values" in "Restrictions" section and then save the option. Check.
  6. Add a new step, in the example, I put the whoami command. Save the step.
  7. Go to the Nodes tab, click on the "Dispatch to Nodes" radio button, and put the option on the "Node Filter" textbox, e.g: ${option.mynode}. Look.

Now you can select any node from your list where the default node is "node01". Result.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1