criteo-cookbooks / rundeck-server

Apache License 2.0
3 stars 15 forks source link

Bug in gem? #8

Closed dblessing closed 9 years ago

dblessing commented 9 years ago

@rveznaver Looking through code I notice: https://github.com/criteo-cookbooks/rundeck-server/blob/master/providers/job.rb#L125. Is this something I need to fix? I'm guessing this is more an issue of how Rundeck server specifies the boolean in the XML and how the parser interprets that. I'm happy to look into fixing something if I can.

Btw, this cookbook looks nice. I wasn't aware you could create a project by just dropping files on the FS. In the gem I'll work on more advanced support for project creation for properties, etc. Would that help clean things up?

rveznaver commented 9 years ago

I think this might be a question for @kamaradclimber, he wrote the job provider.

kamaradclimber commented 9 years ago

@dblessing yes it might be an issue in the way rundeck specify xml/yaml. Actually I haven't checked the real output from rundeck.

about project creation, creating project through fs is easier in chef and does not require additional dependencies. It surprised me that it is impossible to do the same thing for jobs. (but your gem is easy to use, as gitlab is)

rveznaver commented 9 years ago

@kamaradclimber @dblessing I think I might have found another bug. If a value passed to rundeck contains a "+", it has to be encoded as "%2b" otherwise it gets uploaded to rundeck as a space. And since this creates a discrepancy between the hash and the output received from the gem, the provider keeps updating the resource.

dblessing commented 9 years ago

@rveznaver Hmm, the question is where is the bug? The gem or the API? Can you give me some steps to reproduce? I'll try to debug and see where the problem is.

rveznaver commented 9 years ago

@dblessing Here is a minimal job example in yaml needed to reproduce the bug: _samplejob.yaml

- name: job name
  project: ssh_tests
  description: ''
  loglevel: INFO
  options:
    version:
      required: true
      regex: '[0-9]+'
  sequence: 
    commands:
      - exec: echo ${option.version}

sample code

Rundeck.import_job(File.read('sample_job.yaml'))

The option.version value will end up in rundeck as: '[0-9] ' (the '+' becomes a ' ').

dblessing commented 9 years ago

Thanks @rveznaver. I'll test this weekend. I created an issue at https://github.com/dblessing/rundeck-ruby/issues/29

rveznaver commented 9 years ago

Closing the thread as it is a bit off-topic.