smart-proxy detects "master" as valid environment
If [master] section of puppet.conf contains a modulepath, smart-proxy detects "master" as an environment, causing Foreman to attempt to delete the "production" environment and import "master" instead.
Fixes #2654 - Rewrite master as production when only one environment is found
#5 Updated by Greg Sutcliffe about 6 years ago
I can replicate this if there's no production environment specified - obviously if you have a modulepath for both [master] and [production] it just adds master to the environment list. I assume we want to make some kind of hardcoded mapping that if there is only master, it should be named production?
#8 Updated by Greg Sutcliffe about 6 years ago
They're not valid for static definitions, that's true, but it's perfectly allowable to have:
modulepath = /path/to/my/stuff/$environment
and then in your filesystem
This is especially true when using git, where 'master' is the default branch. Worse, Puppet will assume that a static path in [master] is actually an environment called 'production' so we can't just ignore it.
I've added a specific remapping for master->production under certain logic which should fix the issue at hand - if not we can come back and make the logic more complex (again, sigh :P)