I've ran into a strange issue today while using my development environment I was receiving some errors about modules that shouldn't have been used. After looking it looks like my agent (or master) isn't respecting the environment I specify and is actually using the main (master) environment. This used to work and I haven't had any changes beyond a upgrade .. unfortunately I can't recall the previous version although currently the master and agents are running 2.7.1.
Here are the relevant files:
puppet.conf
--
[main]
confdir = /etc/puppet
manifest = $confdir/manifests/site.pp
vardir = /var/lib/puppet
logdir = /var/log/puppet
rundir = /var/run/puppet
ssldir = $vardir/ssl
modulepath = $confdir/modules
[development]
modulepath = $confdir/environments/development/modules
manifest = $confdir/environments/development/manifests/site.pp
[master]
templatedir = /var/lib/puppet/templates
storeconfigs = true
dbadapter = mysql
dbuser = puppet_configs
dbpassword = pass
dbserver = localhost
dbsocket = /var/lib/mysql/mysql.sock
dbname = puppet
reports = log, foreman
pluginsync = true
#external_nodes = /usr/share/foreman/extras/puppet/foreman/files/external_node.rb
#node_terminus = exec
facts_terminus = yaml
environments/development/manifests/site.pp
--
# site.pp
import "modules"
import "nodes"
import "../definitions/*.pp"
filebucket { main: server => puppet }
# Defaults
File { backup => main }
Exec { path => "/usr/bin:/usr/sbin:/bin:/sbin:/usr/local/bin:/usr/local/sbin" }
stage { "pre": before => Stage[main] }
Package {
provider => $operatingsystem ? {
centos => yum,
RedHat => yum,
}
}
--
Now it doesn't even appear the development site.pp is being hit at all - the nodes in my development environment aren't being touched and the main environment is. It's also attempting to use modules from the main environment however is choking saying unauthorized call. It's almost as if it's half using the environment?
--
err: /Stage[pre]/Yum-repos/File[epel-gpg]: Failed to generate additional resources using 'eval_generate: Error 400 on SERVER: Not authorized to call search on /file_metadata/yum-repos/keys/RPM-GPG-KEY-EPEL with {:checksum_type=>"md5", :recurse=>true, :links=>"manage"}
--
This only exists in the master environments site.pp.
The command I'm running to test this is: puppet agent --test --environment development
I'm pretty stumped at this point - any pointers on debugging this / idea's are greatly appreciated.