3.7 版本之后 不建议使用 node 继承, 修改方法如下:
Puppet 4.0 will deprecate node inheritance which is currently a common way to organize resources. I have been using node inheritance to group common configurations into a basic role and then inherit that with a node declaration like the following:
# site.pp
...
node webserver {
# add all generic web server configuration here
}
node web01 inherits webserver {
# any custom things that apply to only web01
}
...
This has worked pretty well for me but with a recent update toPuppet 3.7 on a few nodes, I’m getting the following deprecation warning:
Warning: Deprecation notice: Node inheritance is not supported in Puppet >= 4.0.0.
See http://links.puppetlabs.com/puppet-node-inheritance-deprecation
This quickly becomes annoying as puppet runs frequently on the nodes I manage as I like to be able to quickly deploy changes without a kick or other manual intervention, as well as be able to recover quickly if an error were to occur.
To resolve this issue for now, I have modifed all generic nodes and made them into classes and included those classes in the specific node declarations, similar to the following, which is the modified/updated version of what I included above:
# site.pp
...
class webserver {
# add all generic web server configuration here
}
node web01 {
# include the generic web server class
include webserver
# any custom things that apply to only web01
}
...
Now that works without issuing a deprecation warning which has cleared my inbox quite a bit. The right answer moving forward will be to adhere to the official puppet recommendation of creating modules from these classes and potentially making them parameterized to allow very specific configuration calls from the nodes.
相关文章
- puppet 常见错误解释及解决方法
- Puppet错误收集
- 运维自动化之salt学习笔记
- puppet手册之正则表达式与替换
- puppet手册之数组和条件语句
- puppet 手册之使用selector和case语句
转载请注明:爱开源 » Node inheritance is not supported in Puppet >= 4.0.0
转载请注明:爱开源 » Node inheritance is not supported in Puppet >= 4.0.0