如何将Rundeck密钥存储传递到脚本

时间:2018-03-30 14:59:11

标签: linux automation rundeck

我在其中创建了Rundeck密钥存储和存储密码

然后创建了作业选项enter image description here

然后在内联脚本中指定了以下内容(keys / JIRA是Rundeck密码存储)

curl -XN -u user:keys/JIRA

enter image description here

但密码未通过且authnetication失败,我做错了什么?

1 个答案:

答案 0 :(得分:3)

密码值在传递给脚本时将被展开。以下是一个例子:

- description: ''
  executionEnabled: true
  id: 1f7f5312-0887-4841-a7ef-1c30f712f927
  loglevel: INFO
  name: How to pass Rundeck key storage to script
  nodeFilterEditable: false
  options:
  - name: JiraPass
    secure: true
    storagePath: keys/jira.password
    valueExposed: true
  scheduleEnabled: true
  sequence:
    commands:
    - args: ${option.JiraPass}
      script: |
        #!/usr/bin/env bash

        jira_password=$1
        echo curl -XN -u "user:$1"
    keepgoing: false
    strategy: node-first
  uuid: 1f7f5312-0887-4841-a7ef-1c30f712f927