Moving to Directory Environments

50 views
Skip to first unread message

Rachel Andrew

unread,
Oct 4, 2014, 5:11:47 AM10/4/14
to puppet...@googlegroups.com
Hello

I have a small infrastructure managed by Puppet which I set up when the docs suggested using import to import manifests for each node.

So I currently have just the Production environment. In /etc/puppet/manifest I have a site.pp which imports nodes/*

nodes/* then includes the individual hostname.pp files for each server.

I've read all the docs and *think* I have my head wrapped round it but just thought I would check for any gotchas.

I'm currently getting the two deprecation notices:

- Setting templatedir is deprecated
- The use of import is deprecated

I've created environments/production/modules and environments/production/manifests

I believe I can just set default_manifest in my puppet.conf on the puppetmaster to /etc/puppet/manifests and then all environments will continue to use that (I want to have some dev nodes talking to this puppetmaster soon but I'll just get it all working first)

If I have done the above do I need anything in the production/manifests directory or will it simply default to using that specified as default_manifest?

Having then set a default_manifest which is a directory can I just remove the import and these files will be compiled together? I can see best practice would be to use an ENC, which I may explore but as a small infrastructure I'd just like to make the transition in small steps.

Felix Frank

unread,
Oct 4, 2014, 9:17:34 PM10/4/14
to puppet...@googlegroups.com
Hi,

On 10/04/2014 11:11 AM, Rachel Andrew wrote:
>
> I've created environments/production/modules and
> environments/production/manifests
>
> I believe I can just set default_manifest in my puppet.conf on the
> puppetmaster to /etc/puppet/manifests and then all environments will
> continue to use that (I want to have some dev nodes talking to this
> puppetmaster soon but I'll just get it all working first)

You mean "manifest" I assume - "default_manifest" is not an available
option.

You should set it to '/path/to/environments/production/manifests'. And
no, this is not used for each environment. It is used for production
only. With directory environments, I suppose it's not used at all when
there is a "production" tree among your environment directories.

Before switching to directory environments, set

manifest = /path/to/environments/production/manifests
modulepath = /path/to/environments/production/modules

and remove those settings once directory environments take effect.

> If I have done the above do I need anything in the
> production/manifests directory or will it simply default to using that
> specified as default_manifest?

All manifest files that are not found by the autoloader through
declaration of classes or defined types should be placed directly in
your manifests directory (i.e., files that needed an import statement
earlier).

> Having then set a default_manifest which is a directory can I just
> remove the import and these files will be compiled together? I can see
> best practice would be to use an ENC, which I may explore but as a
> small infrastructure I'd just like to make the transition in small steps.

ENC is best practice? That would be news to me. It's perfectly valid to
omit a node classifier.

Just make sure all unmodularizable code is in the manifest directory, yes.

HTH,
Felix

Hunter Haugen

unread,
Oct 4, 2014, 9:32:25 PM10/4/14
to puppet...@googlegroups.com


On Saturday, October 4, 2014, Felix Frank <Felix...@alumni.tu-berlin.de> wrote:
Hi,

On 10/04/2014 11:11 AM, Rachel Andrew wrote:
>
> I've created environments/production/modules and
> environments/production/manifests
>
> I believe I can just set default_manifest in my puppet.conf on the
> puppetmaster to /etc/puppet/manifests and then all environments will
> continue to use that (I want to have some dev nodes talking to this
> puppetmaster soon but I'll just get it all working first)

If you set default_manifest to /etc/puppet/manifests then it will ignore /etc/puppet/environments/production/manifests. One or the other, but not both.

If you set environmentpath = /etc/puppet/environments and don't set default_manifest, the manifests directory from the environment directory will be read.


You mean "manifest" I assume - "default_manifest" is not an available
option.


default_manifest is new in 3.7 and defaults to ./manifests for use with directory environments.

 
You should set it to '/path/to/environments/production/manifests'. And
no, this is not used for each environment. It is used for production
only. With directory environments, I suppose it's not used at all when
there is a "production" tree among your environment directories.

Before switching to directory environments, set

manifest = /path/to/environments/production/manifests
modulepath = /path/to/environments/production/modules

and remove those settings once directory environments take effect.

> If I have done the above do I need anything in the
> production/manifests directory or will it simply default to using that
> specified as default_manifest?

All manifest files that are not found by the autoloader through
declaration of classes or defined types should be placed directly in
your manifests directory (i.e., files that needed an import statement
earlier).

> Having then set a default_manifest which is a directory can I just
> remove the import and these files will be compiled together? I can see
> best practice would be to use an ENC, which I may explore but as a
> small infrastructure I'd just like to make the transition in small steps.

Yep. Set default_manifest to a directory and it will read all manifests from there. No need for imports.


ENC is best practice? That would be news to me. It's perfectly valid to
omit a node classifier.

Just make sure all unmodularizable code is in the manifest directory, yes.

HTH,
Felix

--
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/54309C29.2080205%40Alumni.TU-Berlin.de.
For more options, visit https://groups.google.com/d/optout.


--


-Hunter

Reply all
Reply to author
Forward
0 new messages