Hey all,
Yup! You caught it. Managed to notice this as well, so forgive the
intrusion on your day.
But I was missing the module name.
file { "/etc/pki/tls/certs/$hostname.mydomain.com.crt":
notify => Service["bacula-fd"],
owner => "root",
group => "root",
mode => 04000,
require => Package["bacula-client","bacula-common"],
source => "puppet:///modules/*bacula*
/$hostname/$hostname.mydomain.com.crt",
}
That actually works! But thanks for the tip on using {} in my variables.
I'll start using that now.
Thanks,
Tim
On Wed, Jan 29, 2014 at 12:33 PM, José Luis Ledesma <
[email protected]> wrote:
> Ups. Looking it again you forgot to set the module name in the puppet://
>
> So the {} is not needed although I think is a good practice
> 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_B3ddA0pWg-C%3DWRGGo77TZBHsdfzjLd9fT4K9g-kMYZ4%3D%3DMg%40mail.gmail.com
> .
>
> For more options, visit https://groups.google.com/groups/opt_out.
>
--
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/CAOZy0ekwLjQNkREhVa%2B3a81biNaMZQ8qdHEngwWicTQMkF2GCw%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.