Erik Ritzman
2014-Oct-29 17:09 UTC
[Puppet Users] NUB here with a question as I go through the tutorials
I am fairly new to DSP and am experimenting as I follow along with the Puppet Tutorial Playing off of the Task 1 in the Conditionals section... my conditionals.pp worked as the example gave; however I was wanting to add on the "else" statement what the "uptime" is and then to state when the device was last rebooted. if $::uptime_hours < 2 {> > $myuptime = "Uptime is less than two hours. \n" > > } > > >> elsif $::uptime_hours < 5 { > > $myuptime = "Uptime is less than five hours. \n" > > } > > >> else { > > $reboot_time = "${who -b}" > > $myuptime = "Uptime is greater than 4 hours. \n > > Your uptime is $uptime.\n > > Your last reboot was $reboot_time." > > } > > >> file {'/root/conditionals.txt': > > ensure => present, > > content => $myuptime, > > } > >My output ends up being Uptime is greater than 4 hours.> Your uptime is 4 days.> Your last reboot was { -b}.Again, I'm just learning here ... how would I go about adding the "bash command to pull the "who -b" and echoing it to the appropriate spot? -- 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 puppet-users+unsubscribe@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/0f583245-d8cb-49ed-8f24-380c169bf4dd%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.