CiscoSystems/puppet-coe — pull request #35 by markvoelker (2014-01-20 19:10:29+00:00)
Title: Use hiera for repo configuration, add pocket param

Previous renditions of this class were not built to use hiera and
had no parameter to set the repository pocket. This poses two major
problems: first, a static string needed to be changed to set the pocket
with each new release, which adds a burden to the release process.
Second, the lack of hiera lookups means that we need to set up
repository information in multiple places (since repositories also
need to be set up via puppet-coi->cobbler for baremetal provisioning).
This violates DRY principles and increases the likelihood of error.
This patch rectifies the problem by adding a parameter to set the
pocket, and converting repository-related parameters to hiera
lookups with reasonable defaults.

The parameters for the Cisco supplemental repo URL and
the Cisco main OpenStack repo are specified slightly differently:
the Cisco supplemental repo is provided as the full URL to the
root of the repository. The main repo, however, is specified
as a URL that isn't quite complete and a static string '/cisco'
is then added to the end within the class. This is inconsistent
and makes it more difficult to re-use the hiera params that set
these up in other classes. Thus, in order to fully resolve this
bug and prevent it from recurring, we also need to rationalize
the two by changing the default for the Cisco main URL to include
the trailing '/cisco' and removes the static addition from the
later code. However because h.0 users may get a hold of this
code unwittingly, their installs would immediately be broken
by such a change as their repository URL would wind up invalid
due to how it was specified in the h.0 version of the YAML in
data/hiera_data/vendor/cisco_coi_common.yaml and/or
data/hiera_data/enable_ha/true.yaml. To deal with this, a
munge has been added to the code to detect the presence of
the old URL and reset it to a valid value...the end result
being that the behavior of h.0 installs is unchanged. Note that
I've also elected to add a search for the FTP version of the
URL since at least one setup is known to exist that uses it.

Partial-Bug: #1269856

Note to reviews: because a complete fix for this bug needs to touch about three different modules, there are a couple of other patches that need to be reviewed/merged together with this one. I'll post the URLs of those here as soon as they're all available.