Separate ENC per environment
I'm trying to set my ENC as a simple script inside each $environment directory, like so:
external_nodes = $confdir/environments/$environment/bin/enc.rb
but when I run a puppet agent, setting the environment from the CLI, like so:
puppet agent --environment=testing123 --test
it wants to use "production" environment anyways:
Warning: Error 400 on SERVER: Failed to find puppet001.example.com via exec: Execution of '/etc/puppet/environments/production/bin/enc.rb puppet001.example.com' returned 1
The puppet master is not reading the $environment that the puppet agent is sending, and is instead using the "environment" variable set in the [master] section on the puppet master (which is "production" by default).
I use git branch environments, so I'd really like to have my enc script, hieradata, and modules all in /etc/puppet/environments/$environment/ so I can test and merge those changes to production when I'm ready.