How to pass Rundeck key storage to script
Asked Answered
A

1

5

I created Rundeck Key storage and stored password in it

Then created Job option enter image description here

Then in inline script i specified folowing (keys/JIRA is Rundeck password storage)

curl -XN -u user:keys/JIRA

enter image description here

But password is not passed and authnetication fails, what am i doing wrong ?

Alicealicea answered 30/3, 2018 at 14:59 Comment(0)
L
7

The password value will be expanded when it is passed to the script. Below is an example:

- 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
Linda answered 30/3, 2018 at 17:10 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.