FAQ
Hi all,

I'm trying to work with hiera database in puppet and i'm having problems
using %{variables} because they don't get the values and i don't know why.

file hiera.yaml:

  cat hiera.yaml
---
:backends: - yaml
            - puppet
:hierarchy:- nodes/%{domain}/%{hostname}
             - os/%{operatingsystem}/%{operatingsystemrelease}
             - %{environment}
             - role/role_%{role}
             - zone/zone_%{zone}
             - location/location_%{location}
             - country/country_%{country}
             - common
:yaml:
         :datadir: /etc/puppet/environments/%{environment}/hieradb
:puppet:
         :datasource: data



Take a look:

hiera -c hiera.yaml role -d
DEBUG: Wed May 08 11:12:37 +0200 2013: Hiera YAML backend starting
DEBUG: Wed May 08 11:12:37 +0200 2013: Looking up role in YAML backend
DEBUG: Wed May 08 11:12:37 +0200 2013: Looking for data source role/role_
DEBUG: Wed May 08 11:12:37 +0200 2013: Cannot find datafile
/etc/puppet/environments//hieradb/role/role_.yaml, skipping
DEBUG: Wed May 08 11:12:37 +0200 2013: Looking for data source zone/zone_
DEBUG: Wed May 08 11:12:37 +0200 2013: Cannot find datafile
/etc/puppet/environments//hieradb/zone/zone_.yaml, skipping
DEBUG: Wed May 08 11:12:37 +0200 2013: Looking for data source
location/location_
DEBUG: Wed May 08 11:12:37 +0200 2013: Cannot find datafile
/etc/puppet/environments//hieradb/location/location_.yaml, skipping
DEBUG: Wed May 08 11:12:37 +0200 2013: Looking for data source
country/country_
DEBUG: Wed May 08 11:12:37 +0200 2013: Cannot find datafile
/etc/puppet/environments//hieradb/country/country_.yaml, skipping
DEBUG: Wed May 08 11:12:37 +0200 2013: Looking for data source common
DEBUG: Wed May 08 11:12:37 +0200 2013: Cannot find datafile
/etc/puppet/environments//hieradb/common.yaml, skipping
DEBUG: Wed May 08 11:12:37 +0200 2013: Hiera Puppet backend starting
DEBUG: Wed May 08 11:12:37 +0200 2013: Looking up role in Puppet backend
/usr/lib/ruby/vendor_ruby/hiera/backend/puppet_backend.rb:51:in `lookup':
uninitialized constant Hiera::Backend::Puppet_backend::Puppet (NameError)
         from /usr/lib/ruby/vendor_ruby/hiera/backend.rb:182:in `lookup'
         from /usr/lib/ruby/vendor_ruby/hiera/backend.rb:179:in `each'
         from /usr/lib/ruby/vendor_ruby/hiera/backend.rb:179:in `lookup'
         from /usr/lib/ruby/vendor_ruby/hiera.rb:64:in `lookup'
         from /usr/bin/hiera:220

For some reason variables doesn't get the value.

Regards

--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

  • Dan White at May 8, 2013 at 12:25 pm
    That's because you have to include variables on the command line when you use hiera this way

    http://docs.puppetlabs.com/hiera/1/command_line.html


    “Sometimes I think the surest sign that intelligent life exists elsewhere in the universe is that none of it has tried to contact us.”
    Bill Waterson (Calvin & Hobbes)

    ----- Original Message -----
    From: "Fco CM" <hipoter@gmail.com>
    To: puppet-users@googlegroups.com
    Sent: Wednesday, May 8, 2013 5:19:50 AM
    Subject: [Puppet Users] Problem with hiera config

    Hi all,

    I'm trying to work with hiera database in puppet and i'm having problems using %{variables} because they don't get the values and i don't know why.

    file hiera.yaml:

    cat hiera.yaml
    ---
    :backends: - yaml
    - puppet
    :hierarchy:- nodes/%{domain}/%{hostname}
    - os/%{operatingsystem}/%{operatingsystemrelease}
    - %{environment}
    - role/role_%{role}
    - zone/zone_%{zone}
    - location/location_%{location}
    - country/country_%{country}
    - common
    :yaml:
    :datadir: /etc/puppet/environments/%{environment}/hieradb
    :puppet:
    :datasource: data



    Take a look:

    hiera -c hiera.yaml role -d
    DEBUG: Wed May 08 11:12:37 +0200 2013: Hiera YAML backend starting
    DEBUG: Wed May 08 11:12:37 +0200 2013: Looking up role in YAML backend
    DEBUG: Wed May 08 11:12:37 +0200 2013: Looking for data source role/role_
    DEBUG: Wed May 08 11:12:37 +0200 2013: Cannot find datafile /etc/puppet/environments//hieradb/role/role_.yaml, skipping
    DEBUG: Wed May 08 11:12:37 +0200 2013: Looking for data source zone/zone_
    DEBUG: Wed May 08 11:12:37 +0200 2013: Cannot find datafile /etc/puppet/environments//hieradb/zone/zone_.yaml, skipping
    DEBUG: Wed May 08 11:12:37 +0200 2013: Looking for data source location/location_
    DEBUG: Wed May 08 11:12:37 +0200 2013: Cannot find datafile /etc/puppet/environments//hieradb/location/location_.yaml, skipping
    DEBUG: Wed May 08 11:12:37 +0200 2013: Looking for data source country/country_
    DEBUG: Wed May 08 11:12:37 +0200 2013: Cannot find datafile /etc/puppet/environments//hieradb/country/country_.yaml, skipping
    DEBUG: Wed May 08 11:12:37 +0200 2013: Looking for data source common
    DEBUG: Wed May 08 11:12:37 +0200 2013: Cannot find datafile /etc/puppet/environments//hieradb/common.yaml, skipping
    DEBUG: Wed May 08 11:12:37 +0200 2013: Hiera Puppet backend starting
    DEBUG: Wed May 08 11:12:37 +0200 2013: Looking up role in Puppet backend
    /usr/lib/ruby/vendor_ruby/hiera/backend/puppet_backend.rb:51:in `lookup': uninitialized constant Hiera::Backend::Puppet_backend::Puppet (NameError)
    from /usr/lib/ruby/vendor_ruby/hiera/backend.rb:182:in `lookup'
    from /usr/lib/ruby/vendor_ruby/hiera/backend.rb:179:in `each'
    from /usr/lib/ruby/vendor_ruby/hiera/backend.rb:179:in `lookup'
    from /usr/lib/ruby/vendor_ruby/hiera.rb:64:in `lookup'
    from /usr/bin/hiera:220

    For some reason variables doesn't get the value.

    Regards



    --
    You received this message because you are subscribed to the Google Groups "Puppet Users" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com.
    To post to this group, send email to puppet-users@googlegroups.com.
    Visit this group at http://groups.google.com/group/puppet-users?hl=en .
    For more options, visit https://groups.google.com/groups/opt_out .


    --
    You received this message because you are subscribed to the Google Groups "Puppet Users" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com.
    To post to this group, send email to puppet-users@googlegroups.com.
    Visit this group at http://groups.google.com/group/puppet-users?hl=en.
    For more options, visit https://groups.google.com/groups/opt_out.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppuppet-users @
categoriespuppet
postedMay 8, '13 at 9:19a
activeMay 8, '13 at 12:25p
posts2
users2
websitepuppetlabs.com

2 users in discussion

Fco CM: 1 post Dan White: 1 post

People

Translate

site design / logo © 2022 Grokbase