(#18577) Extend Hiera to support Proper Yaml Syntax

This patch extends the yaml backend for hiera (and thus puppet ;)
such that key/values in this syntax;

  nginx::sendfile: on
  nginx::worker_connections: 10
  nginx::gzip: on
  nginx::tcp_nopush: on

Can now be specified in Yaml syntax, Eg;

  nginx:
    worker_connections: 10
    sendfile: on
    tcp_nopush: on
    keepalive_timeout: 0
Add support for a hiera variable syntax which interpolates data by
performing a hiera lookup

[Redmine Ticket](https://projects.puppetlabs.com/issues/21367)

This commit adds support for interpolating hiera data in a similar
fashion to how scope interpolation functions in hiera. This commit adds
the syntax `^{foo}` to differentiate hiera lookups from scope lookups,
`%{foo}`.

ips.yaml

    potto01_ip: 10.10.1.52

pott01.yaml

    firewall_rules:
      - "0.0.0.0:22:^{pott01_ip}"

When evaluating the string, `"0.0.0.0:22:^{pott01_ip}"` hiera would
lookup the value for pott01_ip in hiera and interpolate that into the
string, the result being, `"0.0.0.0:22:10.10.1.52"`. This avoids having
to repeatedly perform this type of lookup logic in puppet and allows you
to use your hiera data from within hiera itself.
Change hiera and scope lookup syntax to use a single sigil for interpolation

Use '%' for both types of interpolation. Instead of multiple sigils use
a method syntax to differentiate interpolation lookups:

  - Scope lookup: `%{scope("potto01_ip")}`
  - Hiera lookup: `%{hiera("potto01_ip")}`
(Bug #22166) rm hardcoded hostname dependencies

Prior to this, we had hardcoded burji.puppetlabs.com into
build_defaults.yaml. Since this isn't particularly elegant, this commit
takes that out, and instead uses cnames that point to the right place,
be it burji, or something newer (like burji2)
Merge pull request #143 from melissaanne/maint/stable/rm-hardcoded-dependencies

(Bug #22166) rm hardcoded hostname dependencies
(Bug #22166) rm hardcoded hostname dependencies

Prior to this, we had hardcoded burji.puppetlabs.com into
build_defaults.yaml. Since this isn't particularly elegant, this commit
takes that out, and instead uses cnames that point to the right place,
be it burji, or something newer (like burji2)
Merge branch 'stable'

* stable:
  (Bug #22166) rm hardcoded hostname dependencies
(Bug #22239) rm EOL f17

We're removing support for Fedora 17, because it's officially gone End
of Life.
(#17094) Ensure that a leading $ resolves

The issue was the we could end up in a recursive, infinite loop if the
variable was preceeded by a `$`. This was caused by an old parsing
mechanism that dumbly stripped off characters and sometimes made no
progress. The new system doesn't do that, but this ensures that it
doesn't.
Merge pull request #146 from zaphod42/issue/master/17094-infinite-recursion-on-lookup

(#17094) Ensure that a leading $ resolves
(Maint) Add heira to Gemfile so that you can run it

Without hiera itself being referenced in the Gemfile you can't run
"bundle exec hiera" to try out the command line app. This adds hiera as
a referenced gem to enable that (this is also done in puppet and facter,
so this should bring hiera in line with those).
(Maint) Clean up specs
(#22142) Ensure that :datadir is a String

The previous behavior of the datadir configuration for some backends
allowed it to be an array, but didn't truly handle that case. It worked
because File.join flattens arrays before joining with the file
separator. However the interpolation of variables was not done on array
contents. This lead to users thinking that the datadir was going to be
interpolated, when in fact it wasn't. Instead of trying to cater for
these misconfigured hiera setups, we now raise an error explaining the
problem.
Merge pull request #147 from zaphod42/issue/master/22142-datadir-as-an-array

(#22142) Ensure that :datadir is a String
(21868) Move hiera libary target to /Library/Ruby/Site

We currently drop the hiera library files in /usr/lib/ruby/site_ruby/1.8
OSX, which is a symlink to /Library/Ruby/Site/1.8. As of OSX 10.9 Maverick
this will no longer work because it will be ruby 2.0.0. There are hard way
and easy ways to solve this problem. A hard way would be to somehow
introspect the target host at install time, and then dynamically copy the
payload into the correct ruby version specific path. Another hard way woul be
to create different OSX packages for different versions of OSX. Or, we could
pick the easy way, which is to just install into /Library/Ruby/Site (the
equivalent of /usr/lib/ruby/site_ruby). Since hiera will work on all rubies
shipped with supported versions of OSX, this will "just work".

Signed-off-by: Moses Mendoza <moses@puppetlabs.com>
Update for new osx packaging target

This commit ports work from @ccaviness in
https://github.com/puppetlabs/facter/pull/512 and @djmitche in
https://github.com/puppetlabs/facter/pull/517/files to hiera, to update the osx
packaging for the soon-to-be new osx target install location of
/usr/lib/ruby/site_ruby (/Library/Ruby/Site). In order to ensure Puppet Labs
projects are ready for OSX 10.9, we have to get out of the hardcoded 1.8
directory. In order to transition smoothly, we have to blow away the old
installs and move them to the new one.

Signed-off-by: Moses Mendoza <moses@puppetlabs.com>
Merge pull request #144 from MosesMendoza/maint/master/update_for_new_packaging

Update for new osx packaging target
Merge pull request #148 from MosesMendoza/ticket/master/21868_fix_apple_target

(21868) Move hiera libary target to /Library/Ruby/Site
(22329) Only delete hiera files in the preflight

Previously, the OSX preflight removed the contents of that ‘hiera’ directory,
which also happens to be where the puppet.pkg places the contents of
hiera_puppet. The fix is simple – from the hiera dir, only remove the files
that exist in the ‘hiera’ project, not those in puppet. This commit
accomplishes this by only deleting files, not the directories. It's a bit
crufty, but its better than clobbering the wrong files.

Signed-off-by: Moses Mendoza <moses@puppetlabs.com>
Merge pull request #149 from MosesMendoza/ticket/master/22329_fix_osx_preflight

(22329) Only delete hiera files in the preflight