【问题标题】:Rundeck Branched User optionsRundeck 分支用户选项
【发布时间】:2020-08-20 09:15:36
【问题描述】:

是否可以为其他选项创建顺序分支,例如

选项A的选择--->选项1,2,3,4,5 选项 B ---> 选项 1,2,3,4,5

【问题讨论】:

    标签: user-interface options rundeck


    【解决方案1】:

    为此,您需要 Cascade 选项,您可以先查看this。我留下一个例子来使用它。

    对于这个工作定义:

    <joblist>
      <job>
        <context>
          <options preserveOrder='true'>
            <option enforcedvalues='true' name='transport' valuesUrl='file:/home/user/transport.json' />
            <option enforcedvalues='true' name='vehicle' valuesUrl='file:/home/user/${option.transport.value}' />
          </options>
        </context>
        <defaultTab>summary</defaultTab>
        <description></description>
        <executionEnabled>true</executionEnabled>
        <id>aa888ae8-c414-4dd9-9e01-26e17addb788</id>
        <loglevel>INFO</loglevel>
        <name>Cascade</name>
        <nodeFilterEditable>false</nodeFilterEditable>
        <scheduleEnabled>true</scheduleEnabled>
        <sequence keepgoing='false' strategy='node-first'>
          <command>
            <exec>echo ${option.transport}</exec>
          </command>
          <command>
            <exec>echo ${option.vehicle}</exec>
          </command>
        </sequence>
        <uuid>aa888ae8-c414-4dd9-9e01-26e17addb788</uuid>
      </job>
    </joblist>
    

    第一层,需要定义transport.json调用其他子选项(cars.jsonmotorcycles.json

    [
        {"name":"cars", "value":"cars.json"},
        {"name":"motorcycles",  "value":"motorcycles.json"}
    ]
    

    现在,第二级:cars.json(定义在transport.json

    [
     {"name":"bmw", "value":"bmw"},
     {"name":"fiat", "value":"fiat"}
    ]
    

    motorcycles.json(定义在transport.json

    [
        {"name":"honda", "value":"honda"},
        {"name":"yamaha",  "value":"yamaha"}
    ]
    

    当然,这些JSON文件需要rundeck用户访问。

    【讨论】:

    • 太棒了,乐于助人:-)
    • 是否有动态创建选项?例如具有取决于来自 ansible 的主机文件的选项
    • 需要在作业中定义选项,可能是一些编辑 JSON 值的后台进程(例如更改汽车品牌)。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-06-09
    • 2020-01-29
    • 1970-01-01
    • 2022-01-18
    • 1970-01-01
    相关资源
    最近更新 更多