Puppet: System Administration Automated

Support

Ticket #863 (closed defect: worksforme)

Opened 1 year ago

Last modified 10 months ago

Broken usage of facter vars in config files on client side

Reported by: vitaliel Assigned to: community
Priority: normal Milestone:
Component: client Version: 0.23.2
Severity: normal Keywords: config cache
Cc: Triage Stage: Needs more info
Attached Patches: None Complexity: Unknown

Description

Client caches server configuration with facter variables from puppetmasterd and it is impossible to use below statement:

    file { "trac.ini":
        path => "/etc/trac/trac.ini",
        source => "$p_server/trac/${hostname}-trac.ini"
    }

on client yaml, source url for the file looks like: puppet://puppet.example.com/public/trac/puppet-trac.ini, expected to be puppet://puppet.example.com/public/trac/<client_hostname>-trac.ini

In results fileserver could not find file.

As a work around I must add another variable to each node to tell puppet the right hostname:

    file { "trac.ini":
        path => "/etc/trac/trac.ini",
        source => "$p_server/trac/${my_hostname}-trac.ini"
    }

This bug is present in [cdaad286b1fe5fc3c1ab363c890bb6a8a752c9b5] changeset.

Change History

10/26/07 20:46:39 changed by luke

  • stage changed from Unreviewed to Needs more info.

I don't understand; the first code snippet should work fine. What caching are you talking about? This is puppetd + puppetmasterd, right?

10/27/07 11:23:49 changed by vitaliel

yes, i use puppetd + puppetmasterd.

server: puppet client: app1

Client caches urls with server hostname in /var/lib/puppet/state/localconfig.yaml

urls are wrong: puppet://puppet.example.com/public/trac/puppet-trac.ini, instead of puppet://puppet.example.com/public/trac/app1-trac.ini

10/28/07 21:14:31 changed by luke

The client caches the entire configuration. If you're not seeing the URLs you expect in that cache, then they're not getting generated correctly in the first place and it has nothing to do with the cache. If they're wrong, they'll be cached incorrectly, but that's not the cache's fault.

Can you do a simple test like:

notify { "My hostname is ${hostname}": }

If that doesn't produce the host's hostname during the run, then you've got a serious problem somewhere else.

11/24/07 06:27:22 changed by luke

  • status changed from new to closed.
  • resolution set to worksforme.