FAQ
I'm trying to move forward with our PE setup. However, I'm new and it's
going slow. Right now I'm stuck on getting a node based json file to be
read for hiera.

###
# heira.yaml
# restart pe-puppet each time this file has been edited.

---
:backends:
   - yaml
   - json
:hierarchy:
   - defaults
   - "/node/%{fqdn}"
   - "%{clientcert}"
   - "%{environment}"
   - global

:yaml:
# datadir is empty here, so hiera uses its defaults:
# - /var/lib/hiera on *nix
# - %CommonAppData%\PuppetLabs\hiera\var on Windows
# When specifying a datadir, make sure the directory exists.
   :datadir: "/var/lib/hiera"

:json:
   :datadir: "/var/lib/hiera"

###
# If I have in /var/lib/hiera/global.json:
{
   "admins" : [
     "morticia",
     "gomez",
     "lurch",
     "hand"
     ]
}

# I can do:
  hiera admins
["morticia", "gomez", "lurch", "hand"]


# If I move the file to node/`facter fqdn`.json
# I get no admins.

hiera admins
nil


# What am I missing? At this point I'm assuming operator error but don't
know how to fix it.

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/0c0cfe34-dab4-4133-925e-55da5fd571b3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

  • Tony Thayer at Dec 2, 2014 at 6:32 pm
    You have declared a full folder path instead of a relative one.
    Change "/node/%{fqdn}" to "node/%{fqdn}" and it should work.
    Also as an aside, I would move your defaults to the end of the lookup list.
    The lookup should go from most specific to least specific.

    - Tony
    On Tuesday, December 2, 2014 9:16:49 AM UTC-8, leam hall wrote:

    I'm trying to move forward with our PE setup. However, I'm new and it's
    going slow. Right now I'm stuck on getting a node based json file to be
    read for hiera.

    ###
    # heira.yaml
    # restart pe-puppet each time this file has been edited.

    ---
    :backends:
    - yaml
    - json
    :hierarchy:
    - defaults
    - "/node/%{fqdn}"
    - "%{clientcert}"
    - "%{environment}"
    - global

    :yaml:
    # datadir is empty here, so hiera uses its defaults:
    # - /var/lib/hiera on *nix
    # - %CommonAppData%\PuppetLabs\hiera\var on Windows
    # When specifying a datadir, make sure the directory exists.
    :datadir: "/var/lib/hiera"

    :json:
    :datadir: "/var/lib/hiera"

    ###
    # If I have in /var/lib/hiera/global.json:
    {
    "admins" : [
    "morticia",
    "gomez",
    "lurch",
    "hand"
    ]
    }

    # I can do:
    hiera admins
    ["morticia", "gomez", "lurch", "hand"]


    # If I move the file to node/`facter fqdn`.json
    # I get no admins.

    hiera admins
    nil


    # What am I missing? At this point I'm assuming operator error but don't
    know how to fix it.
    --
    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 view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/f0d431aa-d686-4cb1-825d-8d51c56006a5%40googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Leam hall at Dec 2, 2014 at 6:46 pm
    Hey Tony,

    I made both changes but still getting "nil" for the admin list.

    Leam
    On Tue, Dec 2, 2014 at 1:32 PM, Tony Thayer wrote:
    You have declared a full folder path instead of a relative one.
    Change "/node/%{fqdn}" to "node/%{fqdn}" and it should work.
    Also as an aside, I would move your defaults to the end of the lookup list.
    The lookup should go from most specific to least specific.

    - Tony

    On Tuesday, December 2, 2014 9:16:49 AM UTC-8, leam hall wrote:

    I'm trying to move forward with our PE setup. However, I'm new and it's
    going slow. Right now I'm stuck on getting a node based json file to be read
    for hiera.

    ###
    # heira.yaml
    # restart pe-puppet each time this file has been edited.

    ---
    :backends:
    - yaml
    - json
    :hierarchy:
    - defaults
    - "/node/%{fqdn}"
    - "%{clientcert}"
    - "%{environment}"
    - global

    :yaml:
    # datadir is empty here, so hiera uses its defaults:
    # - /var/lib/hiera on *nix
    # - %CommonAppData%\PuppetLabs\hiera\var on Windows
    # When specifying a datadir, make sure the directory exists.
    :datadir: "/var/lib/hiera"

    :json:
    :datadir: "/var/lib/hiera"

    ###
    # If I have in /var/lib/hiera/global.json:
    {
    "admins" : [
    "morticia",
    "gomez",
    "lurch",
    "hand"
    ]
    }

    # I can do:
    hiera admins
    ["morticia", "gomez", "lurch", "hand"]


    # If I move the file to node/`facter fqdn`.json
    # I get no admins.

    hiera admins
    nil


    # What am I missing? At this point I'm assuming operator error but don't
    know how to fix it.
    --
    You received this message because you are subscribed to a topic in the
    Google Groups "Puppet Users" group.
    To unsubscribe from this topic, visit
    https://groups.google.com/d/topic/puppet-users/WljdlbEZW_8/unsubscribe.
    To unsubscribe from this group and all its topics, send an email to
    puppet-users+unsubscribe@googlegroups.com.
    To view this discussion on the web visit
    https://groups.google.com/d/msgid/puppet-users/f0d431aa-d686-4cb1-825d-8d51c56006a5%40googlegroups.com.

    For more options, visit https://groups.google.com/d/optout.


    --
    Mind on a Mission

    --
    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 view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/CACv9p5q-bVZsb4A6z4kiX25H2QOYVxAiqLrt8twGA_4EmMMnBQ%40mail.gmail.com.
    For more options, visit https://groups.google.com/d/optout.
  • Tony Thayer at Dec 2, 2014 at 7:00 pm
    Do you still have two separate hiera.yaml configuration files? One lives in
    /etc and the one puppet uses is in /etc/puppet. I often forget to replace
    the one in /etc with a symlink to the one in /etc/puppet.

    What is the actual filename of your node's .json file?
    On Tuesday, December 2, 2014 10:46:12 AM UTC-8, leam hall wrote:

    Hey Tony,

    I made both changes but still getting "nil" for the admin list.

    Leam

    On Tue, Dec 2, 2014 at 1:32 PM, Tony Thayer <tony....@gmail.com
    <javascript:>> wrote:
    You have declared a full folder path instead of a relative one.
    Change "/node/%{fqdn}" to "node/%{fqdn}" and it should work.
    Also as an aside, I would move your defaults to the end of the lookup list.
    The lookup should go from most specific to least specific.

    - Tony

    On Tuesday, December 2, 2014 9:16:49 AM UTC-8, leam hall wrote:

    I'm trying to move forward with our PE setup. However, I'm new and it's
    going slow. Right now I'm stuck on getting a node based json file to be
    read
    for hiera.

    ###
    # heira.yaml
    # restart pe-puppet each time this file has been edited.

    ---
    :backends:
    - yaml
    - json
    :hierarchy:
    - defaults
    - "/node/%{fqdn}"
    - "%{clientcert}"
    - "%{environment}"
    - global

    :yaml:
    # datadir is empty here, so hiera uses its defaults:
    # - /var/lib/hiera on *nix
    # - %CommonAppData%\PuppetLabs\hiera\var on Windows
    # When specifying a datadir, make sure the directory exists.
    :datadir: "/var/lib/hiera"

    :json:
    :datadir: "/var/lib/hiera"

    ###
    # If I have in /var/lib/hiera/global.json:
    {
    "admins" : [
    "morticia",
    "gomez",
    "lurch",
    "hand"
    ]
    }

    # I can do:
    hiera admins
    ["morticia", "gomez", "lurch", "hand"]


    # If I move the file to node/`facter fqdn`.json
    # I get no admins.

    hiera admins
    nil


    # What am I missing? At this point I'm assuming operator error but
    don't
    know how to fix it.
    --
    You received this message because you are subscribed to a topic in the
    Google Groups "Puppet Users" group.
    To unsubscribe from this topic, visit
    https://groups.google.com/d/topic/puppet-users/WljdlbEZW_8/unsubscribe.
    To unsubscribe from this group and all its topics, send an email to
    puppet-users...@googlegroups.com <javascript:>.
    To view this discussion on the web visit
    https://groups.google.com/d/msgid/puppet-users/f0d431aa-d686-4cb1-825d-8d51c56006a5%40googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.


    --
    Mind on a Mission
    --
    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 view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/d5a1c3c9-32b5-4da7-b341-44cd3e33242a%40googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Leam hall at Dec 2, 2014 at 7:15 pm
    Hey Tony,

    Only one hiera.yaml, this is PE 3. I'm in a big company that gets
    touchy about sharing hostnames. Really what I did was "mv global.json
    node/`facter fqdn`.json". I've also ensured the pe-puppet group has
    access to the file.

    Leam


    On Tue, Dec 2, 2014 at 2:00 PM, Tony Thayer wrote:
    Do you still have two separate hiera.yaml configuration files? One lives in
    /etc and the one puppet uses is in /etc/puppet. I often forget to replace
    the one in /etc with a symlink to the one in /etc/puppet.

    What is the actual filename of your node's .json file?
    On Tuesday, December 2, 2014 10:46:12 AM UTC-8, leam hall wrote:

    Hey Tony,

    I made both changes but still getting "nil" for the admin list.

    Leam
    On Tue, Dec 2, 2014 at 1:32 PM, Tony Thayer wrote:
    You have declared a full folder path instead of a relative one.
    Change "/node/%{fqdn}" to "node/%{fqdn}" and it should work.
    Also as an aside, I would move your defaults to the end of the lookup
    list.
    The lookup should go from most specific to least specific.

    - Tony

    On Tuesday, December 2, 2014 9:16:49 AM UTC-8, leam hall wrote:

    I'm trying to move forward with our PE setup. However, I'm new and it's
    going slow. Right now I'm stuck on getting a node based json file to be
    read
    for hiera.

    ###
    # heira.yaml
    # restart pe-puppet each time this file has been edited.

    ---
    :backends:
    - yaml
    - json
    :hierarchy:
    - defaults
    - "/node/%{fqdn}"
    - "%{clientcert}"
    - "%{environment}"
    - global

    :yaml:
    # datadir is empty here, so hiera uses its defaults:
    # - /var/lib/hiera on *nix
    # - %CommonAppData%\PuppetLabs\hiera\var on Windows
    # When specifying a datadir, make sure the directory exists.
    :datadir: "/var/lib/hiera"

    :json:
    :datadir: "/var/lib/hiera"

    ###
    # If I have in /var/lib/hiera/global.json:
    {
    "admins" : [
    "morticia",
    "gomez",
    "lurch",
    "hand"
    ]
    }

    # I can do:
    hiera admins
    ["morticia", "gomez", "lurch", "hand"]


    # If I move the file to node/`facter fqdn`.json
    # I get no admins.

    hiera admins
    nil


    # What am I missing? At this point I'm assuming operator error but
    don't
    know how to fix it.
    --
    You received this message because you are subscribed to a topic in the
    Google Groups "Puppet Users" group.
    To unsubscribe from this topic, visit
    https://groups.google.com/d/topic/puppet-users/WljdlbEZW_8/unsubscribe.
    To unsubscribe from this group and all its topics, send an email to
    puppet-users...@googlegroups.com.
    To view this discussion on the web visit

    https://groups.google.com/d/msgid/puppet-users/f0d431aa-d686-4cb1-825d-8d51c56006a5%40googlegroups.com.

    For more options, visit https://groups.google.com/d/optout.


    --
    Mind on a Mission
    --
    You received this message because you are subscribed to a topic in the
    Google Groups "Puppet Users" group.
    To unsubscribe from this topic, visit
    https://groups.google.com/d/topic/puppet-users/WljdlbEZW_8/unsubscribe.
    To unsubscribe from this group and all its topics, send an email to
    puppet-users+unsubscribe@googlegroups.com.
    To view this discussion on the web visit
    https://groups.google.com/d/msgid/puppet-users/d5a1c3c9-32b5-4da7-b341-44cd3e33242a%40googlegroups.com.

    For more options, visit https://groups.google.com/d/optout.


    --
    Mind on a Mission

    --
    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 view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/CACv9p5oL8sZOf%2BfFbOECasYBBFo2TPgXPMDsW8UTt5htsPPjkw%40mail.gmail.com.
    For more options, visit https://groups.google.com/d/optout.
  • Tony Thayer at Dec 2, 2014 at 8:38 pm
    I was able to get my test to work by passing "hiera admins ::fqdn=`facter
    fqdn`"
    The --debug flag clued me in to the fact that it wasn't even looking in the
    nodes folder.
    On Tuesday, December 2, 2014 11:15:24 AM UTC-8, leam hall wrote:

    Hey Tony,

    Only one hiera.yaml, this is PE 3. I'm in a big company that gets
    touchy about sharing hostnames. Really what I did was "mv global.json
    node/`facter fqdn`.json". I've also ensured the pe-puppet group has
    access to the file.

    Leam



    On Tue, Dec 2, 2014 at 2:00 PM, Tony Thayer <tony....@gmail.com
    <javascript:>> wrote:
    Do you still have two separate hiera.yaml configuration files? One lives in
    /etc and the one puppet uses is in /etc/puppet. I often forget to replace
    the one in /etc with a symlink to the one in /etc/puppet.

    What is the actual filename of your node's .json file?
    On Tuesday, December 2, 2014 10:46:12 AM UTC-8, leam hall wrote:

    Hey Tony,

    I made both changes but still getting "nil" for the admin list.

    Leam
    On Tue, Dec 2, 2014 at 1:32 PM, Tony Thayer wrote:
    You have declared a full folder path instead of a relative one.
    Change "/node/%{fqdn}" to "node/%{fqdn}" and it should work.
    Also as an aside, I would move your defaults to the end of the lookup
    list.
    The lookup should go from most specific to least specific.

    - Tony

    On Tuesday, December 2, 2014 9:16:49 AM UTC-8, leam hall wrote:

    I'm trying to move forward with our PE setup. However, I'm new and
    it's
    going slow. Right now I'm stuck on getting a node based json file to
    be
    read
    for hiera.

    ###
    # heira.yaml
    # restart pe-puppet each time this file has been edited.

    ---
    :backends:
    - yaml
    - json
    :hierarchy:
    - defaults
    - "/node/%{fqdn}"
    - "%{clientcert}"
    - "%{environment}"
    - global

    :yaml:
    # datadir is empty here, so hiera uses its defaults:
    # - /var/lib/hiera on *nix
    # - %CommonAppData%\PuppetLabs\hiera\var on Windows
    # When specifying a datadir, make sure the directory exists.
    :datadir: "/var/lib/hiera"

    :json:
    :datadir: "/var/lib/hiera"

    ###
    # If I have in /var/lib/hiera/global.json:
    {
    "admins" : [
    "morticia",
    "gomez",
    "lurch",
    "hand"
    ]
    }

    # I can do:
    hiera admins
    ["morticia", "gomez", "lurch", "hand"]


    # If I move the file to node/`facter fqdn`.json
    # I get no admins.

    hiera admins
    nil


    # What am I missing? At this point I'm assuming operator error but
    don't
    know how to fix it.
    --
    You received this message because you are subscribed to a topic in
    the
    Google Groups "Puppet Users" group.
    To unsubscribe from this topic, visit
    https://groups.google.com/d/topic/puppet-users/WljdlbEZW_8/unsubscribe.
    To unsubscribe from this group and all its topics, send an email to
    puppet-users...@googlegroups.com.
    To view this discussion on the web visit
    https://groups.google.com/d/msgid/puppet-users/f0d431aa-d686-4cb1-825d-8d51c56006a5%40googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.


    --
    Mind on a Mission
    --
    You received this message because you are subscribed to a topic in the
    Google Groups "Puppet Users" group.
    To unsubscribe from this topic, visit
    https://groups.google.com/d/topic/puppet-users/WljdlbEZW_8/unsubscribe.
    To unsubscribe from this group and all its topics, send an email to
    puppet-users...@googlegroups.com <javascript:>.
    To view this discussion on the web visit
    https://groups.google.com/d/msgid/puppet-users/d5a1c3c9-32b5-4da7-b341-44cd3e33242a%40googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.


    --
    Mind on a Mission
    --
    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 view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/a785a621-6433-4c2c-9b2a-bc55e4c5f02b%40googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Leam hall at Dec 2, 2014 at 8:52 pm
    Hmm..yep. Same here. I need to go think some more.

    Thanks!

    Leam
    On Tue, Dec 2, 2014 at 3:38 PM, Tony Thayer wrote:
    I was able to get my test to work by passing "hiera admins ::fqdn=`facter
    fqdn`"
    The --debug flag clued me in to the fact that it wasn't even looking in the
    nodes folder.
    On Tuesday, December 2, 2014 11:15:24 AM UTC-8, leam hall wrote:

    Hey Tony,

    Only one hiera.yaml, this is PE 3. I'm in a big company that gets
    touchy about sharing hostnames. Really what I did was "mv global.json
    node/`facter fqdn`.json". I've also ensured the pe-puppet group has
    access to the file.

    Leam


    On Tue, Dec 2, 2014 at 2:00 PM, Tony Thayer wrote:
    Do you still have two separate hiera.yaml configuration files? One lives
    in
    /etc and the one puppet uses is in /etc/puppet. I often forget to
    replace
    the one in /etc with a symlink to the one in /etc/puppet.

    What is the actual filename of your node's .json file?
    On Tuesday, December 2, 2014 10:46:12 AM UTC-8, leam hall wrote:

    Hey Tony,

    I made both changes but still getting "nil" for the admin list.

    Leam
    On Tue, Dec 2, 2014 at 1:32 PM, Tony Thayer wrote:
    You have declared a full folder path instead of a relative one.
    Change "/node/%{fqdn}" to "node/%{fqdn}" and it should work.
    Also as an aside, I would move your defaults to the end of the lookup
    list.
    The lookup should go from most specific to least specific.

    - Tony

    On Tuesday, December 2, 2014 9:16:49 AM UTC-8, leam hall wrote:

    I'm trying to move forward with our PE setup. However, I'm new and
    it's
    going slow. Right now I'm stuck on getting a node based json file to
    be
    read
    for hiera.

    ###
    # heira.yaml
    # restart pe-puppet each time this file has been edited.

    ---
    :backends:
    - yaml
    - json
    :hierarchy:
    - defaults
    - "/node/%{fqdn}"
    - "%{clientcert}"
    - "%{environment}"
    - global

    :yaml:
    # datadir is empty here, so hiera uses its defaults:
    # - /var/lib/hiera on *nix
    # - %CommonAppData%\PuppetLabs\hiera\var on Windows
    # When specifying a datadir, make sure the directory exists.
    :datadir: "/var/lib/hiera"

    :json:
    :datadir: "/var/lib/hiera"

    ###
    # If I have in /var/lib/hiera/global.json:
    {
    "admins" : [
    "morticia",
    "gomez",
    "lurch",
    "hand"
    ]
    }

    # I can do:
    hiera admins
    ["morticia", "gomez", "lurch", "hand"]


    # If I move the file to node/`facter fqdn`.json
    # I get no admins.

    hiera admins
    nil


    # What am I missing? At this point I'm assuming operator error but
    don't
    know how to fix it.
    --
    You received this message because you are subscribed to a topic in
    the
    Google Groups "Puppet Users" group.
    To unsubscribe from this topic, visit

    https://groups.google.com/d/topic/puppet-users/WljdlbEZW_8/unsubscribe.
    To unsubscribe from this group and all its topics, send an email to
    puppet-users...@googlegroups.com.
    To view this discussion on the web visit


    https://groups.google.com/d/msgid/puppet-users/f0d431aa-d686-4cb1-825d-8d51c56006a5%40googlegroups.com.

    For more options, visit https://groups.google.com/d/optout.


    --
    Mind on a Mission
    --
    You received this message because you are subscribed to a topic in the
    Google Groups "Puppet Users" group.
    To unsubscribe from this topic, visit
    https://groups.google.com/d/topic/puppet-users/WljdlbEZW_8/unsubscribe.
    To unsubscribe from this group and all its topics, send an email to
    puppet-users...@googlegroups.com.
    To view this discussion on the web visit

    https://groups.google.com/d/msgid/puppet-users/d5a1c3c9-32b5-4da7-b341-44cd3e33242a%40googlegroups.com.

    For more options, visit https://groups.google.com/d/optout.


    --
    Mind on a Mission
    --
    You received this message because you are subscribed to a topic in the
    Google Groups "Puppet Users" group.
    To unsubscribe from this topic, visit
    https://groups.google.com/d/topic/puppet-users/WljdlbEZW_8/unsubscribe.
    To unsubscribe from this group and all its topics, send an email to
    puppet-users+unsubscribe@googlegroups.com.
    To view this discussion on the web visit
    https://groups.google.com/d/msgid/puppet-users/a785a621-6433-4c2c-9b2a-bc55e4c5f02b%40googlegroups.com.

    For more options, visit https://groups.google.com/d/optout.


    --
    Mind on a Mission

    --
    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 view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/CACv9p5rCm%2Bh8aUw4oo8cHz3Ruz_hednvODuDX5HTqSTAOYiagQ%40mail.gmail.com.
    For more options, visit https://groups.google.com/d/optout.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppuppet-users @
categoriespuppet
postedDec 2, '14 at 5:16p
activeDec 2, '14 at 8:52p
posts7
users2
websitepuppetlabs.com

2 users in discussion

Leam hall: 4 posts Tony Thayer: 3 posts

People

Translate

site design / logo © 2022 Grokbase