Xavier Beaudouin
2009-Aug-28 13:15 UTC
[Puppet Users] string downcase or how to use downcase an hostname in puppet?
Hi there. I am trying to fix hostnames in our Redhat distributions. Some of our server has some hostname un uppercase, and I need to change them into lowercase because people that use the server rather like lowercase hostnames... I did some basic work : Template : $ cat /var/puppet/templates/rh-network.erb # WARNING this file is autogenered by puppet. Any change there will # be overwritten every 30 minutes # NETWORKING=yes <% if lsbmajdistrelease == "5" %> NETWORKING_IPV6=no <% end %> HOSTNAME="<%= myfqdn %>" Class used : $ cat rh-hostname.pp class hostnameclean { #$myfqdn = downcase ($fqdn) $fqdn.downcase => $myfqn case $operatingsystem { "Redhat" : { file { "/etc/sysconfig/network" : ensure => present, path => "/etc/sysconfig/network", mode => 0644, owner => root, group => root, content => template("rh-network.erb"); } } } } Unfortunatly seems that function downcase doesn''t seems to implemented into my puppet server : FreeBSD 7.2-p2 on i386 platform puppet-0.24.8 A configuration management framework written in Ruby ruby-1.8.7.160_4,1 An object-oriented interpreted scripting language facter-1.5.6 A cross-platform Ruby library for retrieving facts from OS Any hints ? Thanks, /Xavier -- Xavier Beaudouin - http://kazar.net/ http://magicduck.labrute.fr/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---