On 01/29/2014 07:39 PM, Tim Dunphy wrote:
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] <mailto:[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


just start using ${variable} when used in a string (double quoted) . and also use explicit scoping. It is a very good habit and you will only benefit from it.

( and everybody else, including you,  reading your code)



    El 29/01/2014 18:23, "Tim Dunphy" <[email protected]
    <mailto:[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
        <http://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
        <http://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]
        <mailto:puppet-users%[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]
    <mailto:puppet-users%[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 <http://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.


--
Johan De Wit

Open Source Consultant

Red Hat Certified Engineer         (805008667232363)
Puppet Certified Professional 2013 (PCP0000006)
_________________________________________________________
Open-Future Phone +32 (0)2/255 70 70
Zavelstraat 72              Fax       +32 (0)2/255 70 71
3071 KORTENBERG             Mobile    +32 (0)474/42 40 73
BELGIUM                     http://www.open-future.be
_________________________________________________________

Next Events:
Puppet Fundamentals Training | 
http://www.open-future.be/puppet-fundamentals-training-4-till-6th-february
Puppet Intruction Course | 
http://www.open-future.be/puppet-introduction-course-7th-february
Zabbix Certified Training | 
http://www.open-future.be/zabbix-certified-training-10-till-12th-february
Zabbix for Large Environments Training | 
http://www.open-future.be/zabbix-large-environments-training-13-till-14th-february
Subscribe to our newsletter | http://eepurl.com/BUG8H

--
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/52E9662D.9030900%40open-future.be.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to