Global options (from project.properties) not available in valuesUrl #2125

Closed
puremourning opened this Issue Oct 21, 2016 · 0 comments

Projects

None yet

2 participants

@puremourning

Bug report

My Rundeck detail

  • Rundeck version: Rundeck 2.6.9-1 cafe bonbon indigo tower 2016-08-22
  • install type: rpm
  • OS Name/version: Linux RedHat 6.5

Expected Behavior

When creating an option on a job using JOB-YAML, the URL for the options provider can use global variables, such as:

    options:                                                                                                                                                                    
      System:                                                                                                                                                                   
        valuesUrl: http://localhost:${globals.server_port}/v1/systems                                                                                                        
        required: true                                                                                                                                                          

Actual Behavior

Loading the job fails, with the following error:

ERROR RundeckAPICentralDispatcher:      Jobs Document was invalid for format yaml: rundeck.controllers.JobXMLException: Unable to create Job: For input string: "${globals.server_port}"
ERROR RundeckAPICentralDispatcher: Server reported an error: Bad Request
Error: Failed request to load jobs: Jobs Document was invalid for format yaml: rundeck.controllers.JobXMLException: Unable to create Job: For input string: "${globals.server_port}"

How to reproduce Behavior

  • Add the following line to the projects project.properties
project.globals.server_port=4441
  • Create a job with a single option as follows in a file test.yaml:
  - id: 8a2c58bb-6db9-434d-a8dc-16151b27247d                                                                                                                                    
    uuid: 8a2c58bb-6db9-434d-a8dc-16151b27247d                                                                                                                                  
    name: Test                                                                                                                                                                  
    description: Test                                                                                                                                                           
    project: Test                                                                                                                                                                
    group: Test
    options:                                                                                                                                                                    
      TestOption:                                                                                                                                                               
        required: true                                                                                                                                                          
        value: Test                                                                                                                                                             
        valuesUrl: http://localhost:${globals.server_port}/v1/test                                                                                                              
    sequence:                                                                                                                                                                   
      keepgoing: false                                                                                                                                                          
      strategy: node-first                                                                                                                                                      
      commands:                                                                                                                                                                 
      - exec: echo "Hello"                                                                                                                                                      
  • load the job with rd-jobs load -F yaml -d update -p Test -f test.yaml
  • Expect: job is loaded
  • Actual:
[jobs]$ rd-jobs load -F yaml -d update -p XTP -f test.yaml 
ERROR RundeckAPICentralDispatcher:      Jobs Document was invalid for format yaml: rundeck.controllers.JobXMLException: Unable to create Job: For input string: "${globals.buildspec_port}"
ERROR RundeckAPICentralDispatcher: Server reported an error: Bad Request
Error: Failed request to load jobs: Jobs Document was invalid for format yaml: rundeck.controllers.JobXMLException: Unable to create Job: For input string: "${globals.buildspec_port}"

Enhancement request

I accept that this might be intentional, rather than a bug and thus an enhancement request to make project and framework globals available in valuesUrl :)

@gschueler gschueler added the bug label Oct 21, 2016
@gschueler gschueler added this to the 2.6.10 milestone Oct 21, 2016
@gschueler gschueler self-assigned this Nov 2, 2016
@gschueler gschueler closed this in 7c1a0db Nov 3, 2016
@gschueler gschueler removed the in progress label Nov 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment