【问题标题】:Puppet and Agent configurationPuppet 和代理配置
【发布时间】:2015-09-30 08:30:05
【问题描述】:

我实际上是在尝试从 Puppet 创建一个代理,但我遇到了一个问题。

事实上,我的代理中有标准生成的 puppet.conf 文件,全局看起来像这样:

[main]
logdir=/var/log/puppet
vardir=/var/lib/puppet
ssldir=/var/lib/puppet/ssl
rundir=/var/run/puppet
factpath=$vardir/lib/facter
templatedir=$confdir/templates
prerun_command=/etc/puppet/etckeeper-commit-pre
postrun_command=/etc/puppet/etckeeper-commit-post

[master]
# These are needed when the puppetmaster is run by passenger
# and can safely be removed if webrick is used.
ssl_client_header = SSL_CLIENT_S_DN
ssl_client_verify_header = SSL_CLIENT_VERIFY

实际上,我正在尝试找到应该在代理内部设置主信息的位置?我的代理如何连接到此文件中的主服务器?

我在文档中没有发现任何关于此的好消息...

你能帮帮我吗?

【问题讨论】:

    标签: puppet


    【解决方案1】:

    您需要一个代理块。类似于以下内容:

    您可以运行puppet agent --genconfig了解其他属性。

    [agent]
    # The server to which puppet agent should connect 
    server = mypuppet.server.org
    
    # The file in which puppetd stores a list of the classes
    # associated with the retrieved configuratiion.  Can be loaded in
    # the separate ``puppet`` executable using the ``--loadclasses``
    # option.
    # The default value is '$confdir/classes.txt'.
    classfile = $vardir/classes.txt
    
    # Where puppetd caches the local configuration.  An
    # extension indicating the cache format is added automatically.
    # The default value is '$confdir/localconfig'.
    localconfig = $vardir/localconfig
    
    # How often puppet agent applies the client configuration; in seconds.
    # Note that a runinterval of 0 means "run continuously" rather than
    # "never run." If you want puppet agent to never run, you should start
    # it with the `--no-client` option.
    # The default value is '1800'.
    runinterval = 86400
    

    【讨论】:

      【解决方案2】:

      我的/etc/puppet/puppet.conf 里面有这个:

      [agent]
          # The file in which puppetd stores a list of the classes
          # associated with the retrieved configuratiion.  Can be loaded in
          # the separate ``puppet`` executable using the ``--loadclasses``
          # option.
          # The default value is '$confdir/classes.txt'.
          classfile = $vardir/classes.txt
      
          # Where puppetd caches the local configuration.  An
          # extension indicating the cache format is added automatically.
          # The default value is '$confdir/localconfig'.
          localconfig = $vardir/localconfig
      

      我只是在localconfig之后添加了这一行

      server = host.fq.dn.com
      

      【讨论】:

        【解决方案3】:

        木偶大师无需更改puppet.conf

        你需要在你的DNS中添加puppet,你可以运行nslookup puppet来获取它的IP地址

        如果你没有dns服务器,那么你应该在每个puppet代理的本地/etc/hosts中添加,例如

        10.0.0.4 puppet puppet.example.com
        

        之后,当你运行puppet agent -t时,代理会自动与服务器puppet通信。

        注意:请确保 puppet 代理和主服务器之间的防火墙已打开。

        【讨论】:

          猜你喜欢
          • 2020-12-04
          • 1970-01-01
          • 1970-01-01
          • 2018-09-14
          • 2017-02-04
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2014-10-09
          相关资源
          最近更新 更多