【问题标题】:Puppet configuration is getting applied everywherePuppet 配置在各处得到应用
【发布时间】:2014-02-24 18:22:38
【问题描述】:

我是 Puppet 的新手,我正面临一个非常不寻常的问题,我的 Puppet master 正在运行,并且所有代理都完美地配置到该 master。

Puppet Master 中的文件:

现在这是我的 site.pp 文件:

class fileForNodeA{

     file { "/tmp/hello.txt" : 
         content => "This is hello.txt"
     }
}

class fileForNodeB{
     file{ "/tmp/hello.txt" : 
         content => "This is hello1.txt"
     }
}

node  'NodeA'{
   include fileForNodeA
}

node  'NodeB'{
   include fileForNodeB
}

现在客户端的主机名分别是NodeA和NodeB:

当我说时在 NodeA 或 NodeB 上:

puppet agent --no-daemonize --verbose --waitforcert 60 --test

显示这个

Could not retrieve catalog from remote server : Error 400 on server : Could not find|
default node or by name with 'NodeA.com' .....
Notice : Using cached catalog
Info : Applying configuratiuon version '1234567890' 
Notice : Finished catalog run in 0.06 seconds

当我浏览目录 /tmp 时,在此语句之后,它显示了两个文件,即 hello.txthello1.txt,当它说“Could not find..blah blah”时我有点困惑,那为什么它同时应用NodeA和NodeB的部分?

请说明一下,如果我做错了什么,如何根据节点设置来配置这些东西?

请帮忙>>>谢谢AV

【问题讨论】:

    标签: puppet


    【解决方案1】:

    请将此添加为您的 site.pp 中的第一行

    节点默认{ }

    享受吧。

    【讨论】:

    • 想详细说明一下? :)
    • Puppet 客户端在连接到 master 时查找默认配置,如果没有它,则应用完整配置。一旦您指定默认配置木偶客户端不会中断并找到其配置并应用。 Puppet 开发人员应该对此有所作为。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-07-31
    • 1970-01-01
    • 2018-09-14
    • 2017-03-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多