Reginald Choudari
2013-May-02 14:03 UTC
[Puppet Users] High-level design question concerning Hiera with Puppet
Hello, I have been reading for a while now about the uses of Hiera and separating data from configuration. I am planning on migrating my existing Puppet code into a Hiera structured project. I am facing a dilemma dealing with different versions of data. Right now I am configuring a web application that spans across a few machines. I am deploying these machines with environment names, and in my Puppetmaster conf file, I have a dynamic modules/manifests lookup based on the environment name (e.g. manifests = $confdir/environments/$environment/manifests/site.pp). If I have two or three different versions of the same application, how can I use hiera to switch between data without switching between environments? ... That is, how can I select different data for the same environment? I am not sure how to approach this and would like to hear any good ideas. Thanks, Reginald -- 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+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Larry Fast
2013-May-02 21:11 UTC
[Puppet Users] Re: High-level design question concerning Hiera with Puppet
Not quite sure how you''re using environments but here''s what we do... - Environments are configured in puppet.conf and we select the environment at runtime: puppet -t --environment my_env - Each environment is a complete copy of our git source tree, including hiera - We pipeline our release process using branches in git, merging the code from branch to branch & pulling it into an environment-per-pipeline-stage - But hiera does not implicitly know about environments the way puppet.conf knows about them so we do the following # Hiera data directory contains a symlink-per-environment that point to that environment''s hiera tree ls -l /etc/puppet/hiera/data ... my_env => /etc/puppet/environments/my_env/hiera/data # Our hiera.yaml file looks like this :backends: - yaml :yaml: :datadir: ''/etc/puppet/hiera/data'' :hierarchy: # Note: fqdn should only be used to workaround temporary development issues - %{environment}/%{fqdn}/%{module_name} - %{environment}/%{project}/%{server_env}/%{module_name} - %{environment}/%{project}/%{server_env}/common - %{environment}/%{project}/%{role_name}-role/%{module_name} - %{environment}/%{project}/%{role_name}-role/common - %{environment}/%{project}/%{module_name} - %{environment}/%{location}/%{module_name} - %{environment}/%{module_name} - %{environment}/common Cheers Larry Fast -- 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+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.