Tony,

When I explicitly specify --environment=production, Puppet breaks the same 
way as in the OP -- i.e. it simply fails to find the modules (and 
manifests). If I specify a non-existent environment, it throws the normal 
'could 
not find directory environment' error.

So clearly Puppet reads my environments -- it just doesn't read anything 
*within 
*them, modules or manifests. It also doesn't read my 
environments/production/environment.conf file, which I just created:

[root@kmadmin102 puppet]# ls -l /etc/puppet/environments/production/
total 12
-rw-r--r--  1 root root   57 Oct 28 13:39 environment.conf
drwxr-xr-x  3 root root 4096 Oct 24 15:20 manifests
drwxr-xr-x 32 root root 4096 Oct 22 14:51 modules

[root@kmadmin102 puppet]# cat 
/etc/puppet/environments/production/environment.conf
modulepath = /etc/puppet/environments/production/modules

[root@kmadmin102 puppet]# ls -m -w 80 
/etc/puppet/environments/production/modules
apache, apt, awstats, concat, elasticsearch, firewall, gcc, git, inifile, 
java,
km, logrotate, memcached, module_data, mysql, nodejs, perl, php, postgresql,
puppet-puppetdbquery, rclocal, redis, repoforge, rsync, src, stdlib, sudo,
sysctl, wget, xinetd

[root@kmadmin102 puppet]# puppet module list --environment=production
/usr/share/puppet/modules (no modules installed)

Thanks for the pointer about the default manifest, I didn't realize that it 
would actually override the environment ones, I assumed it worked 
additively, like modulepath.

I have disabled the default manifest, but my puppet is still not finding 
the per-environment modules...



On Tuesday, October 28, 2014 1:08:11 PM UTC-4, Tony Thayer wrote:
>
> What happens when you run
> puppet module list --environment=production
> ?
> Your configuration doesn't define which environment the puppet agent lives 
> in, so it _should_default to production but I've been running into this 
> kind of thing myself. This directory structure is working for me:
> /etc/puppet
> - /modules (root modules, stuff downloaded from puppet forge)
> - /manifests (Empty on purpose. Directory environments define my nodes now
> .)
> - /environments
>   - /test01
>   - /test02
>     - /manifests
>       - site.pp
>     - /modules
>       - /allmyenvironment-specific-modules
>     - /hieradata
>   - /production
>     - /manifests
>       - site.pp
>     - /modules
>       - /allmyenvironment-specific-modules
>     - /hieradata
>
> Specifying your default_manifest will override your directory environments 
> as per the documentation. My puppet.conf has some lines like this in it to 
> remind me:
>
> [main]
>     # 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
>     environmentpath = $confdir/environments
>     basemodulepath = $confdir/modules
>     # default manifest prevents the directory environment from taking
>     # default_manifest = /etc/puppet/manifests
>     # Disabling to enable environment-specific site.pp 10/20/2014 tthayer
>     # disable_per_environment_manifest = true
>
> - Tony
>
> On Monday, October 27, 2014 2:43:07 PM UTC-7, Victor Danilchenko wrote:
>>
>> Hi all,
>>
>> I am running a puppetmaster setup on CentOS. We have out production 
>> environment working fine. However, I am trying to migrate from puppet 3.4, 
>> and from config environments to directory environments. I got my 
>> environments tree all set up in the puppet master, but when I activate my 
>> directory environments, puppetmaster suddently can't see any modules or 
>> manifests -- it runs, but returns empty catalog for the agent, and 'puppet 
>> modules list' says I have no modules installed:
>>
>> # puppet module list
>> /usr/share/puppet/modules (no modules installed)
>>
>> None of the other global config files contain anything that references 
>> environments. My environment directory is set up correctly (it works on our 
>> production puppetmaster), and it works when I point the puppetmaster at it 
>> *explicitly*:
>>
>> # puppet module 
>> --confdir=/etc/puppet/environments/production/modules:/usr/share/puppet/modules
>>  
>> list
>> /etc/puppet/environments/production/modules
>>
>> ├── apache (???)
>> ├── awstats (???)
>> etc.
>>
>> Here's my main config file, stripped of comments:
>>
>> [main]
>>     certname=kmadmin102
>>     dns_alt_names=kmadmin102.vistaprint.net,test-kmpuppet,test-kmpuppet.
>> vistaprint.net,kmadmin102.vistaprint.net
>>     logdir = /var/log/puppet/
>>     rundir = /var/run/puppet
>>     ssldir = $vardir/ssl
>>     pluginsync = true
>>     certificate_revocation = false
>>     report = false
>>     configtimeout = 4m
>>     *environmentpath **= $confdir/**environments*
>>     default_manifest = $confdir/manifests
>>     basemodulepath = $confdir/modules:/usr/share/puppet/modules
>> [agent]
>>     classfile = $vardir/classes.txt
>>     localconfig = $vardir/localconfig
>> [master]
>>
>> Can someone see what I am doing wrong?
>>
>> I also have PuppetDB installed, but that shouldn't affect 'puppet 
>> modules list' command. Puppet fails the same way with or without 
>> PuppetDB.
>>
>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/ed5b5695-8356-47c9-bd0b-ceb35ad7d0d2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to