template problem

50 views
Skip to first unread message

Edward Bailey

unread,
Mar 21, 2008, 7:21:55 PM3/21/08
to puppet...@googlegroups.com
Hi

I am running into an issue where I am trying to use puppet to push out a new ldap.conf and the variable i embedded in my template are not being populated with the hostname of each client that I push the new ldap.conf file to. I suspect I am calling the fact wrong but at this point I am not sure. Any ideas are most appreciated.

I want to use the fqdn fact - the new ldap.conf  is pushed to the host but the fqdn  variable is not populated with the hostname of the client. - Thanks!

Here is my class

class ldap_dev_atl01 {

$fqdn = "$fqdn"

file { "/usr/share/ssl/certs/tucosi351_ca.crt":
    mode => 644,
    owner => root,
    group => root,
    source => "puppet://puppet/linux/ldap/tucosi351_ca.crt"
    }

file {"ldap.conf":
      name => "/etc/ldap.conf",
      content => template("/var/lib/puppet/templates/ldap_dev_atl01.erb")
     }

here is my template

host $hostname $hostname

base dc=ads,dc=mycompany,dc=com
ldap_version 3

pam_filter objectclass=posixAccount
pam_check_host_attr yes
pam_password md5

nss_base_passwd ou=People,dc=ads,dc=mycompany,dc=com?one?|(host=\2A)(host=<% fqdn %>)
nss_base_shadow ou=People,dc=ads,dc=mycompany,dc=com?one?|(host=\2A)(host=<% fqdn %>)
nss_base_group  ou=Groups,dc=ads,dc=mycompany,dc=com?one?|(host=\2A)(host=<% fqdn %>)

ssl start_tls
ssl on
tls_cacertdir   /usr/share/ssl/certs/
tls_cacertfile  /usr/share/ssl/certs/tucosi351_ca.crt

Sam Quigley

unread,
Mar 21, 2008, 7:31:29 PM3/21/08
to puppet...@googlegroups.com
Hey Edward,

Try sticking a notice("fqdn is ${fqdn}.") at the top of that class,
and try again. If you see a message like "fqdn is .", then you're
probably seeing #1137 and/or #1147:

http://reductivelabs.com/trac/puppet/ticket/1137
http://reductivelabs.com/trac/puppet/ticket/1147

-sq

Edward Bailey

unread,
Mar 21, 2008, 7:56:05 PM3/21/08
to puppet...@googlegroups.com
thanks - i tried that and I see the fqdn of the server in syslog

I did find my mistake - I needed the following in my template

<%= fqdn %>)

instead

<% fqdn %>)

Thanks again
Reply all
Reply to author
Forward
0 new messages