aboutsummaryrefslogtreecommitdiffstats
path: root/modules/puppet/manifests/hiera.pp
blob: 338b67e104764267948e2e6030eadb2b46163f99 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
class puppet::hiera {
    package { ['ruby-hiera']: }

    if versioncmp($::lsbdistrelease, '4') < 0 {
        package { ['ruby-hiera-puppet']: }
        # ugly hack for puppet 2.7, since hiera has been integrated
        # from puppet 3 only (Mageia 4)
        file { '/etc/puppet/external/hiera':
            ensure  => link,
            # this should be /usr/share/ruby/gems/gems/hiera-puppet-1.0.0
            # on Mageia 3, but we do not have any infra hosts running mga3
            target  => '/usr/lib/ruby/gems/1.8/gems/hiera-puppet-0.3.0/',
            require => Package['ruby-hiera-puppet'],
        }
    }

    # ease the use fo the command line tool
    # who use a different location for the config file
    file { '/etc/hiera.yaml':
        ensure => link,
        target => '/etc/puppet/hiera.yaml',
    }

    file { '/etc/puppet/hiera.yaml':
        content => template('puppet/hiera.yaml'),
    }
}