Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to pass Rundeck key storage to script

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 ?

like image 415
Milister Avatar asked Mar 30 '18 14:03

Milister


1 Answers

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
like image 156
Alex-SF Avatar answered Sep 22 '22 18:09

Alex-SF