Finally found the issue
I never looked into the /etc/puppet directory(my bad), there was the issue, a strange one although but here is what happened, in there were two files(wish I knew why there were that second if we use puppet 0.24.8):
puppet.conf
puppetd.conf
Same content, nothing different, I don't declare the environment in there as I use it in /etc/sysconfig/puppet
[app02 ~]$ grep environment /etc/puppet/puppet.conf /etc/puppet/puppetd.conf
[app02 ~]$ diff /etc/puppet/puppet.conf /etc/puppet/puppetd.conf
[app02 ~]# /usr/sbin/puppetd -t --environment=
developmentinfo: Loading fact drac
info: Loading fact rhelver
info: Loading fact sserial
info: Retrieving plugins
info: Loading fact drac
info: Loading fact rhelver
info: Loading fact sserial
info: mount[localhost]: Mounted /
info: mount[modules]: Mounted
info: mount[plugins]: Mounted
info: Caching catalog at /var/lib/puppet/localconfig.yaml
notice: Starting catalog run
info: Loading fact drac
info: Loading fact rhelver
info: Loading fact sserial
info: Sent transaction report in 1.47 seconds
notice: Finished catalog run in 16.85 seconds
[app02 ~]# grep -m2 -P "development|production" /var/lib/puppet/localconfig.yaml
file: /opt/puppet/
production/classes/yumrepos.pp
file: /opt/puppet/
production/classes/yumrepos.pp
Fixing:
[app02 ~]# rm /etc/puppet/puppetd.confrm: remove regular file `/etc/puppet/puppetd.conf'? y
[app02 ~]# /usr/sbin/puppetd -t --environment=
developmentinfo: Loading fact drac
info: Loading fact rhelver
info: Loading fact sserial
info: Retrieving plugins
info: Loading fact drac
info: Loading fact rhelver
info: Loading fact sserial
info: mount[localhost]: Mounted /
info: mount[modules]: Mounted
info: mount[plugins]: Mounted
info: Caching catalog at /var/lib/puppet/localconfig.yaml
notice: Starting catalog run
info: Loading fact drac
info: Loading fact rhelver
info: Loading fact sserial
notice: //Node[
app02.example.com]/common::ldap/Sudo::Config[standard]/Package[sudo-ldap]/ensure: removed
notice: //Node[
app02.example.com]/common::ldap/Sudo::Config[standard]/Package[sudo]/ensure: created
info: Sent transaction report in 0.37 seconds
notice: Finished catalog run in 18.09 seconds
[app02 ~]# grep -m2 -P "development|production" /var/lib/puppet/localconfig.yaml
file: /opt/puppet/
development/site.pp
file: /opt/puppet/
development/classes/common.pp
So what is doing puppetd is reading both files and for some reason ignoring the --environment flag via command line or the flag in the /etc/sysconfig/puppet when bringing up the daemon with the /etc/init.d/puppet script.
Doing a strace I see both files are being opened with puppetd:
open("/etc/puppet/puppetd.conf", O_RDONLY) = 3
open("/etc/puppet/puppet.conf", O_RDONLY) = 4
I assume it attempts to read puppetd.conf as it was the old config file, but should it ignore the environment flag as it's doing it?
Thanks
--
Tony