Yea, I don't see why you couldn't reach out to a redis instance and grab 
the data and then generate the puppetfile.   Curious if there is a way to 
get the current branch that r10k would be using at time of execution?

On Tuesday, January 26, 2016 at 10:27:58 AM UTC-8, Patrick Lesher wrote:
>
>
>
> On Tuesday, January 26, 2016 at 5:09:11 AM UTC-8, Clayton O'Neill wrote:
>>
>> On Monday, January 25, 2016 at 6:48:07 PM UTC-5, Patrick Lesher wrote:
>>
>>> Has anyone thought about or tried to have r10k run against a mysql 
>>> backend to populate at least the information the puppetfile gives?
>>>
>>> Updating each puppetfile for a large number of “Environments” can be 
>>> burdonsome when we have to update the version on a number of modules.  We 
>>> already have all of our hiera data in a mysql backend and would like to try 
>>> to simplify some processes.
>>>
>>
>> The Puppetfile is Ruby, so in theory you can just access the database 
>> directly form the Puppetfile and loop over the results creating new module 
>> entries.  We do something similar to read a list of modules from a YAML 
>> file with something like this:
>>
>> # This loads the YAML file that Jenkins maintains of the latest commits
>> # approved through Gerrit.
>> PUPPET_DIR = ENV['PUPPET_DIR'] || '/etc/puppet'
>> PUPPETFILE_YAML = File.join(PUPPET_DIR, 'Puppetfile.yaml')
>> if File.readable?(PUPPETFILE_YAML)
>>   require 'yaml'
>>   data = YAML.load_file(PUPPETFILE_YAML)
>>   data['modules'].each_pair do |modulename, moduledata|
>>     mod modulename, :git => moduledata['git'], :commit => moduledata[
>> 'ref']
>>   end
>> end 
>>
>>
> Thank you!  That's a really interesting idea that I will look into.
>
> Garrett,  the current process of keeping the Puppet file in git works 
> fine, the problem is that after a release we might have to update 5-15 
> places in 10+  environments.  I have some of it scripted but would like to 
> have a central place to keep the versions for reporting and ease of 
> updating.
>
> Thanks!
> --Patrick
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/88f506d5-39e2-4d77-9598-68a45b7706f7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to