简体   繁体   English

木偶大师没有将代理主机名/ fqdn传递给enc脚本

[英]puppet master didn't pass agent hostname/fqdn to enc script

Puppet version: 3.6.2 version版本:3.6.2

In order to simplify the management of ssl certificates, our puppet agents use the same certname , certname=agent.puppet.com 为了简化ssl证书的管理,我们的puppet代理使用相同的certnamecertname = agent.puppet.com

When puppet master gets request from agent (hostname: web00.xxx.com) , it executes Enc script with certname as parameter. 当puppet master从代理(hostname: web00.xxx.com)获取请求时,它将执行以certname作为参数的Enc脚本。

node_terminus = exec
external_nodes = /home/ocean/puppet/conf/bce_puppet_bns

puppet.log: puppet.log:

2015-05-06 09:55:34 +0800 Puppet (debug): Executing '/home/ocean/puppet/conf/bce_puppet_bns agent.puppet.com'

How do I configure to make puppet master pass agent's real hostname/FQDN to Enc script like: 如何配置以使人偶主代理将代理的真实主机名/ FQDN传递给Enc脚本,例如:

/home/ocean/puppet/conf/bce_puppet_bns web00.xxx.com

Or how can I get the agent's hostname/FQDN in Enc script ? 或者如何在Enc脚本中获取代理的主机名/ FQDN?

Don't. 别。

Don't use any info other than $clientcert passed from the agent. 除了使用从代理传递的$clientcert之外,请勿使用任何其他信息。

Don't share certificates among different agents. 不要在不同的代理之间共享证书。

There are deeply rooted assumptions in Puppet that each agent node has an individual certificate. 在Puppet中有根深蒂固的假设,即每个代理节点都有一个单独的证书。 You will wreak havoc in your infrastructure by trying such stunts. 通过尝试这种特技,您将对基础架构造成严重破坏

For example, PuppetDB data is usually grouped by owning agents' certnames . 例如,PuppetDB数据通常按拥有代理的certnames分组。 This data will become inconsistent quickly with all agents calling themselves the same, but being quite different of course. 所有代理人都称自己相同,但这些数据会完全不同,因此这些数据很快就会变得不一致。

ensure puppetmaster says this 确保人偶大师说这个

 [master]
   node_name = facter

alter auth.conf so that all the sections have the "agent.puppet.com" cert like this 更改auth.conf,使所有部分都具有“ agent.puppet.com”证书,如下所示

# allow nodes to retrieve their own catalog
path ~ ^/catalog/([^/]+)$
method find
allow $1
allow agent.puppet.com

# allow nodes to retrieve their own node definition
path ~ ^/node/([^/]+)$
method find
allow $1
allow agent.puppet.com

# allow all nodes to access the certificates services
path /certificate_revocation_list/ca
method find
allow *

# allow all nodes to store their own reports
path ~ ^/report/([^/]+)$
method save
allow $1
allow agent.puppet.com

That's just puppetmaster <=> client, Felix is right that if you are using puppetdb that would have to be altered too 那只是puppetmaster <=>客户端,Felix是对的,如果您使用的是puppetdb,那也必须进行更改

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM