Module Directory Layout

33 views
Skip to first unread message

Derek McEachern

unread,
Oct 20, 2014, 12:52:23 PM10/20/14
to puppet...@googlegroups.com

I'm running PE 3.3.1 using directory environments. All our modules are in the /etc/puppetlabs/puppet/environments/production/modules directory.

What I would really like to do is create a subdirectory under here where we allow other uses to put modules

i.e.
/etc/puppetlabs/puppet/environments/production/modules/business_group_a
/etc/puppetlabs/puppet/environments/production/modules/business_group_b


The thought is that business_group_a and business_group_b might both be managing a similar service, like apache, but each one has their own apache module. I would like them to be able to setup

/etc/puppetlabs/puppet/environments/production/modules/business_group_a/apache/
/etc/puppetlabs/puppet/environments/production/modules/business_group_b/apache/


and based on roles and profiles assign the appropriate apache.

Is this possible or are there better ways to accomplish this?

Thanks,
Derek

Felix Frank

unread,
Nov 5, 2014, 4:35:31 PM11/5/14
to puppet...@googlegroups.com
Hi,

so you'd like to sub-namespace modules? I don't think this would work.

Say you forced the contents of puppetlabs-apache into the business_group_a subtree. You would then need to rename classes and defines, e.g. apache -> business_group_a::apache and so forth.

What you are describing should actually be handled through distinct environments. For example

/etcpuppetlabs/puppet/environments/business_group_a/group-modules
/etcpuppetlabs/puppet/environments/business_group_a/modules -> ../../production/modules

(Making sure that .../business_group_a/environment.conf sets modulepath=modules:group-modules).

This would be a clunky way to allow "group modules" next to centrally curated modules. But then, you probably want to look at r10k and its tool chain to get better control over the environments.

HTH,
Felix
Reply all
Reply to author
Forward
0 new messages