Closed tomtheun closed 7 years ago
Hi @tomtheun,
I like the idea although I'm not sure Rundeck accepts string in a non uuid-like format.
I did a quick and dirty test on one of my boxes:
ERROR GrailsContextLoaderListener: Error initializing the application: Cluster mode: 'rundeck.server.uuid' in framework.properties was not a valid UUID: rea8CTp2ed
It is probably better to follow this recipe to generate the ramdom uuid: https://github.com/rundeck/rundeck/issues/1455
What do you think? Thanks!
You could even do it with a pure Ruby function a la https://github.com/olavmrk/puppet-fqdn_rand_uuid ?
@danifr, good that you checked it with cluster mode enabled. We only run one instance, which doesn't give any errors when using a non uuid value, so I assumed it would be working as expected.
I can't think of a nice way to use uuidgen
directly and keeping it testable.
I like the suggestion from @petems of using a Puppet function for it. But both adding a whole new dependency for one function or copying the code from that lib don't have my preference. I guess getting the uuid function in Puppet stdlib would be the nicest solutions.
Any thoughts?
Hi @tomtheun,
I guess getting the uuid function in Puppet stdlib would be the nicest solutions.
That would be best. Is anyone familiar with getting functions accepted in stdlib?
IMO it'd be better to add it as a function to this module, then see about having it accepted into stdlib:
1) Wont have to upgrade the Stdlib dependancy 2) Easier to test
A full path could be: 1) Add rundeck_uuid function to module, use that in code 2) Open ticket and PR to add uuid function to stdlib 3) When that gets gets merged to stdlib and released, update dependancy and switch over to stdlib function 👍
Created ticket: https://tickets.puppetlabs.com/browse/MODULES-4188
PR merged into STDLIB, can probably update this code to use the new function when tagged and released 👍
See https://github.com/puppetlabs/puppetlabs-stdlib/pull/700
That was quick! I can update this PR later this week. Then it's just waiting for the stdlib release with the new function.
Closing, since #322 replaced it.
When the 'serialnumber' fact is not present the 'rundeck.server.uuid' setting is set to 'undef'. Also when the 'strict_variables' setting is set to true, the Puppet parser will fail if the 'serialnumber' fact is not present.
When the 'serialnumber' fact is present it will still use it, if not it will fallback to using a random value based on the FQDN. Therefor this change should not break existing installations.