puppet cert list -all
"server.example.com" (25:11:E6:A6:21:55:A3:4F:30:E4:C7:50:92:4C:63:50) (alt names: "DNS:puppet", "DNS:puppet.example.com", "DNS:server.example.com")
+ "client.example.com" (9C:DA:6F:89:C3:5C:4E:73:5A:9F:A6:35:66:FE:53:8E)
前面带“+”表示证书签发成功
6、例子测试
服务端
cat /etc/puppet/manifests/site.pp
node default {
file {
"/tmp/helloworld.txt": content => "hello, world";
}
}
Note:
err: Could not retrieve catalog from remote server: Error 400 on SERVER: Could not find default node or by name with 'client.example.com, client.example, client' on node client.example.com
warning: Not using cache on failed catalog
err: Could not retrieve catalog; skipping run
可能是/etc/puppet/manifests/site.pp 这个文件书写格式有问题
客户端
puppet agent --test --server=server.example.com
cat /tmp/helloworld.txt
hello, world
三、在服务端安装Puppet的dashboard工具
1、安装设置mysql
yum install mysql mysql-devel mysql-server -y
在/etc/my.cnf中[mysqld]下加入max_allowed_packet = 32M
/etc/init.d/mysqld start
chkconfig mysqld on
mysqladmin -u root password '123456'
cat create_dashboard.sql #创建数据库
CREATE DATABASE dashboard CHARACTER SET utf8;
CREATE USER 'dashboard'@'localhost' IDENTIFIED BY '123456';
GRANT ALL PRIVILEGES ON dashboard.* TO 'dashboard'@'localhost';
FLUSH PRIVILEGES;