进入到/etc/puppet目录里,
<span style="font-size:24px;">[root@yinzhipeng puppet]# ll
总用量 32
-rw-r--r-- 1 root root 4178 4月 26 02:54 auth.conf
-rw-r--r-- 1 root root 2 10月 17 18:13 autosign.conf
drwxr-xr-x 3 root root 4096 10月 17 15:32 environments
-rw-r--r-- 1 root root 1462 4月 26 02:52 fileserver.conf
drwxr-xr-x 2 root root 4096 10月 17 18:08 manifests
drwxr-xr-x 3 root root 4096 10月 17 18:05 modules
-rw-r--r-- 1 root root 990 10月 17 18:02 puppet.conf</span>
<span style="font-size:24px;">[root@yinzhipeng puppet]# cd modules/</span>
然后创建模块
<span style="font-size:32px;">[root@yinzhipeng modules]# mkdir unzip</span>
<span style="font-size:32px;">[root@yinzhipeng modules]# cd unzip
[root@yinzhipeng unzip]# mkdir manifests/</span>
<span style="font-size:32px;">一定要创建这个文件夹</span>
<span style="font-size:32px;">这个是模块初始文件夹</span>
<a target=_blank href="mailto:root@yinzhipeng"><span style="font-size:32px;">root@yinzhipeng</span></a><span style="font-size:32px;"> manifests]# touch init.pp</span>
<span style="font-size:32px;">这个一定要创建 代码的开始</span>
<span style="font-size:32px;">[root@yinzhipeng manifests]# cat init.pp
class unzip {
package {"unzip":
ensure => present,
}
}</span>
<span style="font-size:32px;">这个类名一定要和模块名字相同</span>
<span style="font-size:32px;"></span>
<span style="font-size:32px;"></span>
<span style="font-size:32px;">然后进入/etc/puppet/manifests</span>
<span style="font-size:32px;">创建site.pp</span>
<span style="font-size:32px;">[root@yinzhipeng manifests]# cat site.pp
include unzip</span>
<span style="font-size:32px;">这个引入模块的意思 </span>
<span style="font-size:32px;">到此 完成
</span>