Project

General

Profile

Bug #2654

smart-proxy detects "master" as valid environment

Added by Jared Nelson about 6 years ago. Updated about 1 year ago.

Status:
Closed
Priority:
High
Category:
Puppet
Target version:
Difficulty:
Triaged:
Bugzilla link:
Pull request:
Team Backlog:
Fixed in Releases:
Found in Releases:

Description

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.

Associated revisions

Revision 1c60be63 (diff)
Added by Greg Sutcliffe about 6 years ago

Fixes #2654 - Rewrite master as production when only one environment is found

Revision 5e4e4adf (diff)
Added by Greg Sutcliffe about 6 years ago

Fixes #2654 - Rewrite master as production when only one environment is found
(cherry picked from commit 1c60be634d26163cc7fe43f5adad1f9f75c3309d)

History

#1 Updated by Dominic Cleal about 6 years ago

  • Category set to Puppet

Which version of the proxy do you have installed?

#2 Updated by Jared Nelson about 6 years ago

I'm using the Debian nightly builds. Currently 9999+debian1~nightlybuild1370929161

#3 Updated by Dominic Cleal about 6 years ago

  • Priority changed from Normal to High
  • Target version set to 1.2.0

Ok, thanks.

#4 Updated by Greg Sutcliffe about 6 years ago

  • Status changed from New to Assigned
  • Assignee set to Greg Sutcliffe

#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?

#6 Updated by Greg Sutcliffe about 6 years ago

  • Status changed from Assigned to Ready For Testing

#7 Updated by Jared Nelson about 6 years ago

Puppet documentation says that [main], [master], [agent], and [user] are forbidden environment names. Wouldn't it make sense for smart-proxy to simply ignore modulepaths within these blocks, as they don't/can't specify environments?

#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:

[master]
modulepath = /path/to/my/stuff/$environment

and then in your filesystem

/path/to/my/stuff/master
/path/to/my/stuff/production
/path/to/my/stuff/development

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)

#9 Updated by Anonymous about 6 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

#10 Updated by Greg Sutcliffe about 1 year ago

  • Target version deleted (1.2.0)

Also available in: Atom PDF