标签:
创建必要的目录。Manifests存放模块的主要配置文件init.pp
Puppet在应用类后会首先加载init.pp读取必要的信息
如果init.pp使用templates函数,会读取templates目录下的erb模块文件
当前的变量也会传入templates函数中
mkdir -p /etc/puppet/modules/test/{manifests,templates,files} vi /etc/puppet/modules/test/manifests/init.pp 定义类: class test{ file{"/tmp/$hostname.txt": context => "Hello world"; } } 定义模板 vi /etc/puppet/modules/test/templates/test.esb hostname <%= fqdn %> 定义节点信息:节点目录可以任意定义,只需再site配置文件中import即可ru: vi /etc/pupprt/manifests/nodes/agent1.harry.com.pp node ‘agent1.harry.com‘{ include test } 在site.pp文件中import节点信息 vi /etc/puppet/manifests/site.pp import nodes/agent1.harry.com.pp
标签:
原文地址:http://my.oschina.net/u/204498/blog/509744