I tried using it in a template: <%= memory %> and it put "0" in my file when i switched the variable name to the_memory, it worked Eugene Ventimiglia Director of Systems GridApp Systems e: eventi@gridapp.com o: 646 452 4081 _______________________________________________ Puppet-users mailing list Puppet-users@madstop.com https://mail.madstop.com/mailman/listinfo/puppet-users
On Dec 21, 2007 9:29 AM, Eugene Ventimiglia <eventi@gridapp.com> wrote:> I tried using it in a template: > > <%= memory %> > > and it put "0" in my file > > when i switched the variable name to the_memory, it workedWhat is your memory variable? Is that set manually in the manifest, or are you trying to get the memory size from facter? facter | grep memory memoryfree => 602.52 MB memorysize => 1001.94 MB
Eugene Ventimiglia
2007-Dec-21 17:35 UTC
Re: Any magic to the name ''memory'' in templates?
Here''s a bigger snippet to illustrate define vmserver::create_vm ($disk_size = "8Gb" ,$memory = "1024") { $vm_memory = $memory #... snipped file { "/var/lib/vmware/Virtual Machines/nfs/${name}/${vmxname}.vmx": ensure => present, mode => 755, replace => false, # source => ''puppet:///files/vmware/rhel4.vmx'', content => template(''/etc/puppet/files/vmware/rhel4.vmx.erb''), require => File["/var/lib/vmware/Virtual Machines/nfs/${name}"] } #... snipped } and the template: #!/usr/bin/vmware config.version = "8" virtualHW.version = "4" displayName = "<%= name %>" guestOS = "rhel4" priority.grabbed = "normal" priority.ungrabbed = "normal" memsize = "<%= vm_memory %>" #memsize = "<%= memory %>" floppy0.present = "FALSE" scsi0.present = "TRUE" scsi0.virtualDev = "lsilogic" scsi0:0.redo = "" scsi0:0.present = "TRUE" scsi0:0.fileName = "<%= vmxname %>.vmdk" ... I''ve edited it as shown, and it works, but the resulting file contains -----Original Message----- From: puppet-users-bounces@madstop.com [mailto:puppet-users-bounces@madstop.com] On Behalf Of Joshua Timberman Sent: Friday, December 21, 2007 11:52 AM To: Puppet User Discussion Subject: Re: [Puppet-users] Any magic to the name ''memory'' in templates? On Dec 21, 2007 9:29 AM, Eugene Ventimiglia <eventi@gridapp.com> wrote:> I tried using it in a template: > > <%= memory %> > > and it put "0" in my file > > when i switched the variable name to the_memory, it workedWhat is your memory variable? Is that set manually in the manifest, or are you trying to get the memory size from facter? facter | grep memory memoryfree => 602.52 MB memorysize => 1001.94 MB _______________________________________________ Puppet-users mailing list Puppet-users@madstop.com https://mail.madstop.com/mailman/listinfo/puppet-users