On Sunday, September 14, 2014 11:52:46 AM UTC-5, bluethundr wrote:
>
> Hey all,
>
>  I just setup puppet 3.7.0 and foreman 1.6.0 on a new host. And I just 
> learned about the new syntax replacing the include directive.
>


I don't know what you are talking about.  There is no new DSL syntax 
replacing the 'include' directive.  Since 3.5 there has been the 'contain' 
directive / function which *supplements* 'include'.  Puppet 3.7 has a 
feature allowing you to declare a directory as your main manifest; this 
largely obviates 'import' (*not* 'include').  Did you mean one of those?  
Either way, 'include' is still alive and well, and in many cases it is 
still the best choice for declaring classes.

 

>
>  I found this example of how to do this in puppet enterprise:
>
> [main] environmentpath = $confdir/environments default_manifest = 
> $confdir/manifests basemodulepath = 
> $confdir/modules:/opt/puppet/share/puppet/modules
>
>

So it looks like you are indeed trying to use directory environments and a 
main manifest directory.  You should peruse the relevant documentation to 
get a handle on how all this works: 
https://docs.puppetlabs.com/puppet/latest/reference/environments.html, 
https://docs.puppetlabs.com/puppet/latest/reference/dirs_manifest.html.

 

> But I am using the community version and this did not work for me. I am 
> not sure if that is why or if I might have done something wrong.
>
>

The open source version has these features, too.  If they are not working 
for you then yes, you are probably doing something wrong.  Note in 
particular that the configuration directives you are working with operate 
in concert with a corresponding layout of your manifests -- you will not 
get the results you expect or want if the config file and the file system 
disagree about where your files are.

 

> Here's my main section of puppet.conf:
>
> [main]
>     confdir = /etc/puppet
>     # The Puppet log directory.
>     # The default value is '$vardir/log'.
>     logdir = /var/log/puppet
>
>     # Where Puppet PID files are kept.
>     # The default value is '$vardir/run'.
>     rundir = /var/run/puppet
>
>     # Where SSL certificates are kept.
>     # The default value is '$confdir/ssl'.
>     ssldir = $vardir/ssl
>
>     # Allow services in the 'puppet' group to access key (Foreman + proxy)
>     privatekeydir = $ssldir/private_keys { group = service }
>     hostprivkey = $privatekeydir/$certname.pem { mode = 640 }
>
>     # Puppet 3.0.x requires this in both [main] and [master] - harmless on 
> agents
>     autosign       = $confdir/autosign.conf { mode = 664 }
>
>     environmentpath = $confdir/environments
>
>     default_manifest =  $confdir/manifests
>
>     basemodulepath = 
> $confdir/modules:$confdir/environments/production/modules
>
> The ultimate goal I have is to include my nodes definitions in this file 
> living in the manifests directory:
>
> /etc/puppet/manifests/nodes.pp
>
> Can anybody out there help clue me in on how I can include my node 
> definitions in puppet 3.7.0?
>
>

You seem to be trying to use a combination of directory environments and 
traditional configuration.  You would do well to move over all the way to 
directory environments.  To do so:

   1. Create directory /etc/puppet/environments/production if it does not 
   exist.  This will be the environment directory for the default environment 
   ("production"); it must be readable and traversible by the master process.
   2. Modify the 'basemodulepath' config directive to "basemodulepath = 
   $confdir/modules".  You neither need nor want the other directory you 
   specified in the *base* module path (at least at this point).  
   Alternatively, remove this setting altogether, as what you're left with is 
   the default.
   3. Restart the master.

Keep the 'environmentpath' and 'default_manifest' settings as you already 
have them.  Make sure you do not have any conflicting directives in the 
[master] section of your config.  Also, if Puppet is managing its own 
config then make sure your changes are not being clobbered.


John

 

-- 
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/7497cd3f-2518-42e0-b6fa-45956b02d593%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to