FAQ
Hi,

I'm trying to categorize our Puppet agent nodes via custom facts. To do
this, I've placed a simple text file "custom_facts.txt" into
C:\ProgramData\PuppetLabs\facter\facts.d with content

[facts]
role = PuppetDev

When I call facter on the agent node, I can see the new fact.

On the server, I've added a line

   - "role/%{::role}"

into /etc/hiera.yaml, below the :hierarchy: line and restarted the master.

Finally, I've added /etc/puppet/hiera/role/PuppetDev.yaml with content

---
puppet_agent::version: 3.4.3

while /etc/puppet/hiera/common.yaml has

puppet_agent::version: 3.4.2

To verify that the correct version is delivered, I run

hiera puppet_agent::version ::role=PuppetDev

and get the correct version (3.4.3) back.

However, when I run the puppet agent on the node, it has role unset and
thus it doesn't try to update the puppet agent.

What am I doing wrong here?

Master is 3.4.3, agents are 3.4.2.

Thanks...

     Dirk
--

*Dirk Heinrichs*, Senior Systems Engineer, Engineering Solutions
*Recommind GmbH*, Von-Liebig-Straße 1, 53359 Rheinbach
*Tel*: +49 2226 1596666 (Ansage) 1149
*Email*: dhs@recommind.com
*Skype*: dirk.heinrichs.recommind
www.recommind.com <http://www.recommind.com>



http://www.recommind.com

--
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/531ED4B8.5060001%40recommind.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

  • Craig Dunn at Mar 11, 2014 at 9:31 am
    Drop the :: from your hiera.yaml, it's being taken literally as '::role'
    rather than defining scope.

    Regards
    Craig

    On Tue, Mar 11, 2014 at 9:17 AM, Dirk Heinrichs wrote:

    Hi,

    I'm trying to categorize our Puppet agent nodes via custom facts. To do
    this, I've placed a simple text file "custom_facts.txt" into
    C:\ProgramData\PuppetLabs\facter\facts.d with content

    [facts]
    role = PuppetDev

    When I call facter on the agent node, I can see the new fact.

    On the server, I've added a line

    - "role/%{::role}"

    into /etc/hiera.yaml, below the :hierarchy: line and restarted the master.

    Finally, I've added /etc/puppet/hiera/role/PuppetDev.yaml with content

    ---
    puppet_agent::version: 3.4.3

    while /etc/puppet/hiera/common.yaml has

    puppet_agent::version: 3.4.2

    To verify that the correct version is delivered, I run

    hiera puppet_agent::version ::role=PuppetDev

    and get the correct version (3.4.3) back.

    However, when I run the puppet agent on the node, it has role unset and
    thus it doesn't try to update the puppet agent.

    What am I doing wrong here?

    Master is 3.4.3, agents are 3.4.2.

    Thanks...

    Dirk
    --

    *Dirk Heinrichs*, Senior Systems Engineer, Engineering Solutions
    *Recommind GmbH*, Von-Liebig-Straße 1, 53359 Rheinbach
    *Tel*: +49 2226 1596666 (Ansage) 1149
    *Email*: dhs@recommind.com
    *Skype*: dirk.heinrichs.recommind
    www.recommind.com

    --
    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/531ED4B8.5060001%40recommind.com<https://groups.google.com/d/msgid/puppet-users/531ED4B8.5060001%40recommind.com?utm_medium=email&utm_source=footer>
    .
    For more options, visit https://groups.google.com/d/optout.


    --
    *Enviatics *| Automation and configuration management
    http://www.enviatics.com | @Enviatics
    Puppet Training http://www.enviatics.com/training/

    --
    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/CACxdKhFd11Y9apR30w45P9GDfjBw-NxLXkVDftPs0DxBWuYx%3Dg%40mail.gmail.com.
    For more options, visit https://groups.google.com/d/optout.
  • Dirk Heinrichs at Mar 11, 2014 at 10:21 am

    Am 11.03.2014 10:31, schrieb Craig Dunn:
    Drop the :: from your hiera.yaml, it's being taken literally as
    '::role' rather than defining scope.
    That doesn't help, unfortunately. OTOH, using a predefined fact works
    fine. For example, I also have a line

       - "node/%{::fqdn}"

    in hiera.yaml and I can overwrite values from common.yaml with values
    taken from node/myhost.recommind.com.yaml without problem.

    To me it looks like facter is reading the file containing the custom
    fact, while the agent does not.

    Bye...

         Dirk
    --

    *Dirk Heinrichs*, Senior Systems Engineer, Engineering Solutions
    *Recommind GmbH*, Von-Liebig-Straße 1, 53359 Rheinbach
    *Tel*: +49 2226 1596666 (Ansage) 1149
    *Email*: dhs@recommind.com
    *Skype*: dirk.heinrichs.recommind
    www.recommind.com <http://www.recommind.com>



    http://www.recommind.com

    --
    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/531EE38C.6020604%40recommind.com.
    For more options, visit https://groups.google.com/d/optout.
  • Matthew Burgess at Mar 11, 2014 at 7:47 pm

    On 11 Mar 2014 10:21, "Dirk Heinrichs" wrote:
    To me it looks like facter is reading the file containing the custom
    fact, while the agent does not.

    Puppet uses /etc/puppet/hiera.yaml (or /etc/puppetlabs/puppet/hiera.yaml
    for PE) not /etc/hiera.yaml. You could symlink them so that the hiera
    command and puppet both use the same configuration.

    Regards

    Matt

    --
    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/CAKUTv3KQc5oA_g4a8sw6%3DV3qZ_ArLB9rcjVoKTuUfMHcW6NrDw%40mail.gmail.com.
    For more options, visit https://groups.google.com/d/optout.
  • Dirk Heinrichs at Mar 11, 2014 at 11:45 am

    Am 11.03.2014 10:17, schrieb Dirk Heinrichs:

    To do this, I've placed a simple text file "custom_facts.txt" into
    C:\ProgramData\PuppetLabs\facter\facts.d with content

    [facts]
    role = PuppetDev
    Got it to work by removing the blanks:

    role=PuppetDev

    Bye...

         Dirk
    --

    *Dirk Heinrichs*, Senior Systems Engineer, Engineering Solutions
    *Recommind GmbH*, Von-Liebig-Straße 1, 53359 Rheinbach
    *Tel*: +49 2226 1596666 (Ansage) 1149
    *Email*: dhs@recommind.com
    *Skype*: dirk.heinrichs.recommind
    www.recommind.com <http://www.recommind.com>



    http://www.recommind.com

    --
    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/531EF73A.6060204%40recommind.com.
    For more options, visit https://groups.google.com/d/optout.
  • Garrett Honeycutt at May 1, 2014 at 12:06 am

    On Tuesday, March 11, 2014 7:44:58 AM UTC-4, Dirk Heinrichs wrote:
    Am 11.03.2014 10:17, schrieb Dirk Heinrichs:

    To do this, I've placed a simple text file "custom_facts.txt" into
    C:\ProgramData\PuppetLabs\facter\facts.d with content

    [facts]
    role = PuppetDev


    Got it to work by removing the blanks:

    role=PuppetDev

    Bye...

    Dirk
    --

    *Dirk Heinrichs*, Senior Systems Engineer, Engineering Solutions
    *Recommind GmbH*, Von-Liebig-Straße 1, 53359 Rheinbach
    *Tel*: +49 2226 1596666 (Ansage) 1149
    *Email*: d...@recommind.com <javascript:>
    *Skype*: dirk.heinrichs.recommind
    www.recommind.com


    Hi,

    I ran into a similar issue and wanted to post the fix here for others. To
    create the text file I used

       echo key=value > file.txt

    After looking in /var/lib/puppet/yaml/facts/<certname>.yaml, I found that
    there was trailing whitespace as I had 'key=value '. To fix, I edited in
    notepad to remove the trailing whitespace.

    Hope this saves someone else some time :>
    -g

    --
    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/57fafb9b-bd9c-46dc-a9a8-598721c0909f%40googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppuppet-users @
categoriespuppet
postedMar 11, '14 at 9:17a
activeMay 1, '14 at 12:06a
posts6
users4
websitepuppetlabs.com

People

Translate

site design / logo © 2022 Grokbase