Hi all, I'm jumping into learning puppet with the modules on Puppetlabs websites, but I'm running into a few issues and I could use some help. I'm currently working on the second exercise here:
http://docs.puppetlabs.com/learning/variables.html I can write a manifest that installs NTP for CentOS: package { 'ntp': ensure => installed, } file { '/etc/ntp.conf': owner => 'root', group => 'root', mode => '640', content => "server 0.rhel.pool.ntp.org", notify => Service['ntpd'], require => Package['ntp'], } service { 'ntpd': ensure => running, enable => true, hasstatus => true, hasrestart => true, } But when I try to use the $case variable to select the correct OS, I get an error. Here's my manifest: package { 'ntp': ensure => installed, } file { '/etc/ntp.conf': content => "server 0.rhel.pool.ntp.org", owner => 'root', mode => '640', require => Package['ntp'], } case $operatingsystem { centos, redhat: { $ntp = "ntp" } debain, ubuntu: { $ntp = "ntpd" } default: { fail("Unrecognized operating system for webserver") } } if $ntp == 'ntp' { service { 'ntp': name => $ntp, ensure => running, enable => true, hasrestart => true, hasstatus => true, } } else { service { 'ntpd': name => $ntp, ensure => running, enable => true, hasstatus => true, hasrestart => true, } } I've tried to reorder things a few different ways but I have a feeling this is related to how I'm using the case variable and the if/else statement. My error is this: err: /Stage[main]//Service[ntp]/ensure: change from stopped to running failed: Could not start Service[ntp]: Execution of '/sbin/service ntp start' returned 1: at /root/learning-manifests/ntp.pp:24 Which confuses me, because the after the manifest is finished the /etc/ ntp.conf file is written and configured correctly, NTP is installed, but it's calling '/sbin/service ntp start' as opposed to '/etc/init.d/ ntp start.' When I run the vanilla script, everything configures correctly and ntp(d) is started. Why is my second script using /sbin when it seems that it should be using /etc/init.d/? Thanks! Jesse -- 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+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.