r10k and dynamic environments

112 views
Skip to first unread message

Steven James

unread,
Mar 26, 2014, 2:40:45 AM3/26/14
to puppet...@googlegroups.com
Hi all.

I'm trying to get r10k to pull down a hieradata repo, and deploy it to the appropriate 

I've added the following section to /etc/r10k.yaml

 hda-hieradata:

    remote: 'ssh://g...@stash.blah.com.au/puppet/blah-hieradata.git'

    basedir: "/etc/puppet/environments/${::environment}/hieradata/"

    prefix: true


I also tried -     basedir: "{::confdir}/hiera" - which also didn't work.


Is r10k able to use variables in the basedir?


This post would suggest that it may be possible;


http://garylarizza.com/blog/2014/03/07/puppet-workflow-part-3b/


e.g. 'basedir'

=> "${::settings::confdir}/hiera",


Any thoughts from anybody?


Regs,


Steven

Jacob Fleming-Gale

unread,
Mar 26, 2014, 7:01:52 AM3/26/14
to puppet...@googlegroups.com
Hi Steven,

r10k does not accept Puppet variables or facts as it run's outside of Puppet, the confusion is because Gary's example is using the awesome r10k puppet module by Zack to setup the r10k configuration, hence it can use the puppet facts or variables to create and manage the /etc/r10k.yaml configuration file.

The created r10k configuration file should something like the example below, which deploys environment directories with manifests and modules to /etc/puppetlabs/puppet/environments and environmental hieradata to /etc/puppetlabs/puppet/hieradata

--------------------
# The location to use for storing cached Git repos
:cachedir: '/var/cache/r10k'

# A list of git repositories to create
:sources:
  # This will clone the git repository and instantiate an environment per
  # branch in /etc/puppetlabs/puppet/environments
  :local:
    remote: 'git://localhost/puppet-environments-nohiera.git'
    basedir: '/etc/puppetlabs/puppet/environments'

  :hieradata:
    remote: 'git://localhost/puppet-hieradata.git'
    basedir: '/etc/puppetlabs/puppet/hieradata'

:purgedirs:
 - '/etc/puppetlabs/puppet/environments'
--------------------



Regards
Jacob







--
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...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/CAB_ORUsw53%2B3MrnixWXUxoO5G2RZgqjymNNPu2zs0WB-LTNbdQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages