On Wednesday, February 15, 2017 at 2:41:29 PM UTC-6, Ligne Six wrote: > > Hello folks, > > I'm wondering if it is possible to define-declare a class. Something like > inlining: > > instead of: > > ``` > include hello_distro > > > > > > > > class hello_distro { > > > > notify { "Running on distro: ${facts['os']['family']}": } > > > > } > ``` > > have something like: > > ``` > include class hello_distro { > ... > } > > No, Puppet has no such feature *per se*, but I don't see what advantage you hope it would provide, relative to simply declaring the contents of the class body directly at the same point.
Moreover, if you're inclined to declare a class in the same manifest in which you define it -- which runs counter to the prevailing views on good style -- I don't see how being able to merge those into a single statement would provide more than the most trivial advantage. You would save yourself literally *one word* of code by not repeating the class name. John John -- 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 puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/ced43a16-5da2-4ec1-a209-f562a615d644%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.