notify资源
notify资源主要用于输出puppet的辅助提示信息,在puppet的执行过程中通过这些辅助信息了解执行的过程,它并不会改变任何操作状态.
参数:
notify { ‘resource title‘: name => # (namevar) An arbitrary tag for your own reference; the... message => # The message to be sent to the... withpath => # Whether to show the full object path. Defaults... # ...plus any applicable metaparameters. }
name:标示名.
messages:输出描述信息.
withpath:是否显示完整对象路径。
示例:
[root@sh-web1 ~]# cat notify.pp $sum = 8 + 4 notify {"sum": message => "${sum}", withpath => true, }
运行结果:
[root@sh-web1 ~]# puppet apply notify.pp Notice: Compiled catalog for sh-web1.localdomain in environment production in 0.05 seconds Notice: /Stage[main]/Main/Notify[sum]/message: 12 Notice: /Stage[main]/Main/Notify[sum]/message: defined ‘message‘ as ‘12‘ Notice: Finished catalog run in 0.03 seconds
本文出自 “青衫解衣” 博客,请务必保留此出处http://215687833.blog.51cto.com/6724358/1976347
原文地址:http://215687833.blog.51cto.com/6724358/1976347