[root@puppet nodes]# pwd
/etc/puppet/manifests/nodes
[root@puppet nodes]# cat agent.domain.com.pp
node 'agent.domain.com' {
include test
}
# 入口文件导入所有的节点
[root@puppet manifests]# pwd
/etc/puppet/manifests
[root@puppet manifests]# cat site.pp
import "nodes/*.domain.com.pp"
# agent 端
复制代码[root@agent1 yum.repos.d]# puppet agent --test --server puppet.domain.com
Notice: Ignoring --listen on onetime run
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Caching catalog for agent1.domain.com
Info: Applying configuration version '1408524165'
Notice: /Stage[main]/Test/File[/tmp/agent1.txt]/ensure: defined content as '{md5}7509cca57ec6faec2d5dd2c76a68ea0b'
Notice: Finished catalog run in 0.10 seconds
# 验证文件
[root@agent1 yum.repos.d]# cat /tmp/agent1.txt
hello agent1.txt
安装Puppet foreman
准备工作:
1.在安装foreman之前呢咱们需要安装epel的源否则在执行yum -y install foreman-installer 很多包是安装不上的
复制代码rpm -ivh http://mirrors.sohu.com/fedora-epel/6/x86_64/epel-release-6-8.noarch.rpm
一、安装
复制代码yum -y install http://yum.theforeman.org/releases/1.6/el6/x86_64/foreman-release.rpm // 推荐使用官方的源自动解决依赖问题
yum -y install foreman-installer // # 开始安装 如果发现有的包安装报错需要仔细检查是不是源的问题(推荐epel源) 或者 防火墙 和 selinux
二、运行foreman安装(以下二选其一即可,推荐非交互安装方式)
复制代码foreman-installer // # 这里所有的过程都是自动的 时间有点长,是太长了 好长...我又邪恶了~~
foreman-installer -i // # 如果需要自定义安装 可以使用 -i 选择交互式安装 详情请参考官方手册
# 貌似每次我安装都会卡在这里,不知道什么原因 我每次都会把它结束掉重新执行foreman-installer 就好了 无解。。
Installing Debug: Package[foreman-postgresql](provider=yum): [22%] [....................
5794 ? Ss 0:04 /usr/bin/python /usr/bin/yum -d 0 -e 0 -y install foreman-postgresql // 进程一直卡在这里
# 安装完后可以很清楚的看到httpd启动失败 咱们这里需要手动启动一下 /etc/init.d/httpd start 安装两次都是失败不知道是不是个例
Could not start Service[httpd]: Execution of '/sbin/service httpd start' returned 1: Starting httpd: [FAILED]
/Stage[main]/Apache::Service/Service[httpd]/ensure: change from stopped to running failed: Could not start Service[httpd]: Execution of '/sbin/service httpd start' returned 1: Starting httpd: [FAILED]
# 启动foreman-proxy










