You have to use {}.  So it should be something like

   source =>
"puppet:///modules/${::hostname}/${::hostname}.mydomain.com.key",

I've used :: too to avoid looking at the local scope.

Regards
El 29/01/2014 18:23, "Tim Dunphy" <[email protected]> escribió:

> Hi All,
>
>  I'm attempting to distribute TLS certs based on the $hostname fact in my
> config manifest like so:
>
> class bacula::config {
>
>
>   file { "/etc/bacula/bacula-fd.conf":
>       notify  => Service["bacula-fd"],
>       owner => "root",
>       group => "root",
>       mode => 0640,
>       require => Package["bacula-client","bacula-common"],
>       content => template("bacula/bacula_fd__config.erb"),
>      }
>
>
>     file { "/etc/pki/tls/private/$hostname.mydomain.com.key":
>       notify  => Service["bacula-fd"],
>       owner => "root",
>        group => "root",
>       mode => 04000,
>       require => Package["bacula-client","bacula-common"],
>       source => "puppet:///modules/$hostname/$hostname.mydomain.com.key",
>
>      }
>
> }
>
> Correct me if I'm wrong, but should the above syntax not work?
>
>
> Because I see when I try to run the config on the client site I get this
> error:
>
> [root@puppet:/etc/puppet] #puppet agent --test
> Info: Retrieving plugin
> Info: Caching catalog for puppet.mydomain.com
> Info: Applying configuration version '1391015907'
> Notice: /Stage[main]/Bacula::Install/Exec[create_working_dir]/returns:
> executed successfully
> Error:
> /Stage[main]/Bacula::Config/File[/etc/pki/tls/private/puppet.mydomain.com.key]:
> Could not evaluate: Could not retrieve information from environment
> production source(s) puppet:///modules/puppet/puppet.mydomain.com.key
> Notice: /Stage[main]/Bacula::Service/Service[bacula-fd]: Dependency
> File[/etc/pki/tls/private/puppet.mydomain.com.key] has failures: true
> Warning: /Stage[main]/Bacula::Service/Service[bacula-fd]: Skipping because
> of failed dependencies
> Notice: Finished catalog run in 1.63 seconds
>
>
> Can someone please offer an opinion as to why this may not be working?
>
> Thanks
> Tim
> --
> GPG me!!
>
> gpg --keyserver pool.sks-keyservers.net --recv-keys F186197B
>
>  --
> 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/CAOZy0e%3Dx%2BcFLjW%3D-H54cttNLV77bhdbNwSg0%3DLNWH7pSoiT3CQ%40mail.gmail.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
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/CAF_B3dc5%3DKL96joPdOm47UKSUyNxPcjhNYe02dZ0VszU8ywumg%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to