puppet 只看到内部 dns 名称而不是主机名
puppet only sees internal dns name instead of hostname
我正在尝试操纵亚马逊 EC2 主机。我首先确保 puppet ssl 目录是空的:
[root@web3:~] #ls -lh /var/lib/puppet/ssl/
total 0
在 /etc/hosts
中设置我的主机名
[root@web3:~] #cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
10.0.2.101 web3.company.com web3
为服务器提供我想要的主机名并验证它:
[root@web3:~] #hostname web3
[root@web3:~] #hostname
web3
[root@web3:~] #hostname -f
web3.company.com
然而,当我 运行 puppet 命令将其注册到 puppet 服务器时,它仍然会提供内部 ec2 ip 地址,而不是我试图给它的主机名:
[root@web3:~] #puppet agent --test --waitforcert 60 --server puppet.company.com
Info: Creating a new SSL key for ip-10-0-2-101.ec2.internal
Info: Caching certificate for ca
Info: Caching certificate_request for ip-10-0-2-101.ec2.internal
Info: Caching certificate for ca
我在这里错过了什么?我怎样才能让 puppet 看到我想要的主机名而不是亚马逊提供的内部 IP dns?
我认为这些是您正在寻找的文档http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/set-hostname.html
免责声明
我从未使用过 puppet,也不知道它到底在做什么
您可以在 Puppet 配置文件中指定 certname
:https://docs.puppet.com/puppet/4.10/config_file_main.html
例如,在您的 EC2 节点上,您可以有一个具有以下 ini 格式设置的 puppet.conf
:
[main]
certname = web3.company.com
这将指定您想要的证书名称,只要您没有在 [master]
部分中覆盖它..
我正在尝试操纵亚马逊 EC2 主机。我首先确保 puppet ssl 目录是空的:
[root@web3:~] #ls -lh /var/lib/puppet/ssl/
total 0
在 /etc/hosts
中设置我的主机名[root@web3:~] #cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
10.0.2.101 web3.company.com web3
为服务器提供我想要的主机名并验证它:
[root@web3:~] #hostname web3
[root@web3:~] #hostname
web3
[root@web3:~] #hostname -f
web3.company.com
然而,当我 运行 puppet 命令将其注册到 puppet 服务器时,它仍然会提供内部 ec2 ip 地址,而不是我试图给它的主机名:
[root@web3:~] #puppet agent --test --waitforcert 60 --server puppet.company.com
Info: Creating a new SSL key for ip-10-0-2-101.ec2.internal
Info: Caching certificate for ca
Info: Caching certificate_request for ip-10-0-2-101.ec2.internal
Info: Caching certificate for ca
我在这里错过了什么?我怎样才能让 puppet 看到我想要的主机名而不是亚马逊提供的内部 IP dns?
我认为这些是您正在寻找的文档http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/set-hostname.html
免责声明 我从未使用过 puppet,也不知道它到底在做什么
您可以在 Puppet 配置文件中指定 certname
:https://docs.puppet.com/puppet/4.10/config_file_main.html
例如,在您的 EC2 节点上,您可以有一个具有以下 ini 格式设置的 puppet.conf
:
[main]
certname = web3.company.com
这将指定您想要的证书名称,只要您没有在 [master]
部分中覆盖它..