Am Montag, 7. Mai 2018 09:21:20 UTC+2 schrieb [email protected]: > > Actually you don't have to inherit, you can (and should) just have > something like: > > class dk_oracle_java::install { > include dk_oracle_java > package { 'oracle-java8-installer': > ensure => $::dk_oracle_java::version, > } > } > >
> The above include is not necessary if you are already incuding the > dk_oracle_java class somewhere else, just be sure that the class is > included before you refer to its variables. > I personally consider the *::install, *::config, *::service classes as private and they should not include the parent class - they should be contained from the main class. Outside of the module only the main class should be included. The *::install and other classes should fail if included from outside (maybe with help of: https://github.com/puppetlabs/puppetlabs-stdlib#assert_private). And if not yet using: I would recommend you the PDK (https://puppet.com/docs/pdk/1.x/pdk.html) which will also create basic test classes for you. - Thomas -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/3b8a6265-20ca-4a6d-b56a-d94b6611d145%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
