On Mon, 18 Jul 2016 20:54:43 +0200 Tobias wrote: TK> for testing Hiera a have written a common.yaml with TK> TK> qmonitoring::db::icinga2_ido_password: "mypwd34" TK> qmonitoring::db::icinga2_webdb_password: "mypwd544" TK> TK> and I have a module named qmonitoring with a class named TK> TK> class qmonitoring::db { TK> TK> $new_var = $icinga2_ido_password, TK> TK> } TK> [...] TK> With $icinga2_ido_password it doesn't work with hiera( ...) it works. TK> TK> How can I automatically access the Hiera variable in my class with the TK> priority lookup without having to use hiera(...)?
Try making it a parameter: class qmonitoring::db ( $icinga2_ido_password = 'default' ) { ... Robert -- Senior Software Engineer @ Parsons -- 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/20160718151126.4972f3dc%40ispx.vb.futz.org. For more options, visit https://groups.google.com/d/optout.
pgpbolwG5tTbz.pgp
Description: OpenPGP digital signature