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 

-- 
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/ff549278-dbc0-4b21-8153-9e4657c27c98%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to