我正在使用远程 URL 选项,该选项可连接到远程 Web 服务器以检索所需的数据。只需使用这个, https://rundeck:[电子邮件受保护]有效。但是,我想以安全的方式传递密码,所以...
选项 1 使用“安全密码输入”,并且从密钥存储中检索密码,但是密码不会添加到
中的远程 URL选项 2,使用远程 URL,https://rundeck:${option.password.value}@myserver.com。我的远程服务器收到的密码为 ${option.password.value},而不是选项 1 中检索到的实际密码值。我知道安全远程身份验证不能在选项中使用,但我不认为我看到了限制关于我想用安全做什么 † Rundeck 文档中的密码输入。
最后,在安全 † 密码输入选项中输入密码会将密码添加到上面提到的 URL。我已经测试并验证了 ${option.password.value} 值可以在作业步骤中传递,该部分有效。但是,它似乎不适用于级联选项。
目前,安全选项值并未作为远程选项的一部分进行扩展,您可以在here建议(类似于this)。或者,您可以为此创建一个特定的自定义插件。
另一种方法是设计一个工作流程,使用 HTTP 工作流程步骤插件(将您的安全密码作为 URL 中身份验证的一部分传递)来访问 Web 服务 + JQ Filter 生成所需的数据,然后在另一个/步骤您可以使用数据变量获取该数据。
像这样:
- defaultTab: nodes
description: ''
executionEnabled: true
id: 7f34f7ff-c4a3-4616-a2aa-0df491450366
loglevel: INFO
name: HTTP
nodeFilterEditable: false
options:
- name: mypass
secure: true
storagePath: keys/password
valueExposed: true
plugins:
ExecutionLifecycle: null
scheduleEnabled: true
sequence:
commands:
- configuration:
authentication: None
checkResponseCode: 'false'
method: GET
printResponse: 'true'
printResponseToFile: 'false'
proxySettings: 'false'
remoteUrl: https://user:${option.mypass}@myserver.com
sslVerify: 'true'
timeout: '30000'
nodeStep: false
plugins:
LogFilter:
- config:
filter: .
logData: 'true'
prefix: result
type: json-mapper
type: edu.ohio.ais.rundeck.HttpWorkflowStepPlugin
- exec: echo "name 2 is ${data.Name2}"
keepgoing: false
strategy: node-first
uuid: 7f34f7ff-c4a3-4616-a2aa-0df491450366
Rundeck 通过为远程 URL 提供多个选项解决了这个问题,请参阅文档。 https://docs.rundeck.com/docs/manual/job-options.html#option-model-provider