木偶:如何覆盖/重新定义外部子类(详细的用例和示例)
我试图说明的用例是什么时候声明某个项目(eq mysqld服务)与默认configuration,可以包含在每个节点(class stripdown在这个例子中,basenode),仍然能够覆盖这个相同的项目一些特定的类(例如mysql :: server),被特定的节点(如myserver.local) 我用下面的例子说明了这个用例,我想在所有节点上禁用mysql服务,但是在特定的节点上激活它。 但是当然,Puppetparsing失败,因为Service [mysql]包含两次。 当然,mysql :: server类没有任何关系,可以作为剥离类的子类 有没有办法来覆盖服务[“MySQL”],或将其标记为主要的,或者其他? 我正在考虑虚拟物品和实现function,但它只允许多次应用物品,而不是重新定义或覆盖。 # In stripdown.pp : class stripdown { service {"mysql": enable => "false", ensure => "stopped" } } # In mysql.pp : class mysql::server { service { mysqld: enable => true, ensure => running, hasrestart => true, hasstatus => true, path => "/etc/init.d/mysql", […]