proftpd module service error

70 views
Skip to first unread message

Tim Dunphy

unread,
Feb 11, 2014, 10:46:10 AM2/11/14
to puppet...@googlegroups.com
Hey puppet,

I thought I had all my ducks in a row with this puppet module I had written for proftpd. I'm attempting to get the proftpd config to notify the proftpd service, but without much luck.

[root@ops:~] #puppet agent --test
Info: Loading facts in /var/lib/puppet/lib/facter/os_maj_version.rb
Info: Caching catalog for ops.mydomain.com
Error: Failed to apply catalog: Could not find dependent Sevice[proftpd] for File[/etc/proftpd.conf] at /etc/puppet/modules/proftpd/manifests/config.pp:9

Here's my class definitions:

class proftpd {
  include proftpd::service, proftpd::install, proftpd::config

}

class proftpd::config {

  file { "/etc/proftpd.conf":
      owner => "root",
      group => "root",
      mode => 0640,
      content => template("proftpd/proftpd.conf.erb"),
      notify => Sevice["proftpd"],
     }

}

class proftpd::service {

  service { "proftpd":
  ensure => running,
  }

}

And just for completeness:

class proftpd::install {


  package { [ "proftpd", "proftpd-mysql" ]:
     ensure => present,
  }

}

Again, it seems pretty straightforward to me! Can someone please let me know what I may be missing? 


Thanks


--
GPG me!!

gpg --keyserver pool.sks-keyservers.net --recv-keys F186197B

Jerald Sheets

unread,
Feb 11, 2014, 10:49:45 AM2/11/14
to puppet...@googlegroups.com
Permission on the files?


--
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...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/CAOZy0ekfLnU8pyGE5kSUXDQhZ_HPwFCaGqvt0YQyaSjioaEGbQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

signature.asc

Tim Dunphy

unread,
Feb 11, 2014, 10:56:29 AM2/11/14
to puppet...@googlegroups.com
Hi, 

Thanks for getting back to me. The files in the 'templates' directory were owned by 'root:root'. Thinking that may be the problem, I chowned that directory to 'puppet:puppet'.

[root@puppet:/etc/puppet] #ls -l modules/proftpd/templates/
total 12
-rw-r--r-- 1 puppet puppet 7258 Feb 11 10:08 proftpd.conf.erb
-rw-r--r-- 1 puppet puppet   50 Feb  9 09:04 root_my_cnf.erb

But I am still getting the same error:

root@ops:~] #puppet agent --test
Info: Loading facts in /var/lib/puppet/lib/facter/os_maj_version.rb
Info: Caching catalog for ops.jokefire.com
Error: Failed to apply catalog: Could not find dependent Sevice[proftpd] for File[/etc/proftpd.conf] at /etc/puppet/modules/proftpd/manifests/config.pp:9

Thanks,
Tim

Ken Barber

unread,
Feb 11, 2014, 10:57:59 AM2/11/14
to Puppet Users
> Error: Failed to apply catalog: Could not find dependent Sevice[proftpd] for File[/etc/proftpd.conf] at /etc/puppet/modules/proftpd/manifests/config.pp:9

Sevice/Service ... its a typo.

ken.

Tim Dunphy

unread,
Feb 11, 2014, 11:02:04 AM2/11/14
to puppet...@googlegroups.com
Whoops! Yep that was it. :-/

The class now reads:

class proftpd::config {

  file { "/etc/proftpd.conf":
      owner => "root",
      group => "root",
      mode => 0640,
      content => template("proftpd/proftpd.conf.erb"),
      notify => Service["proftpd"],
     }

}


It's working fine now:

[root@ops:~] #puppet agent --test
Info: Loading facts in /var/lib/puppet/lib/facter/os_maj_version.rb
Info: Caching catalog for ops.mydomain.com
Info: Applying configuration version '1392134032'
Notice: /Stage[main]/Proftpd::Config/File[/etc/proftpd.conf]/ensure: defined content as '{md5}08fcd69207dce8fa4fdc16c036e38fc0'
Info: /Stage[main]/Proftpd::Config/File[/etc/proftpd.conf]: Scheduling refresh of Service[proftpd]
Notice: /Stage[main]/Proftpd::Service/Service[proftpd]/ensure: ensure changed 'stopped' to 'running'
Info: /Stage[main]/Proftpd::Service/Service[proftpd]: Unscheduling refresh on Service[proftpd]
Notice: /Stage[main]/Puppet::Service/Service[puppet]/ensure: ensure changed 'stopped' to 'running'
Info: /Stage[main]/Puppet::Service/Service[puppet]: Unscheduling refresh on Service[puppet]
Notice: Finished catalog run in 77.16 seconds
You have mail in /var/spool/mail/root

Thanks for your help!

Tim


--
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...@googlegroups.com.

Rafael Cristaldo

unread,
Feb 11, 2014, 11:02:58 AM2/11/14
to puppet...@googlegroups.com
Try to change your notify on config.pp

notify => Sevice["proftpd"], TO notify => Class['proftpd::service],


Before running ...test all the manifests with:

# puppet parser validate init.pp | config.pp etc....

Rafael Cristaldo

unread,
Feb 11, 2014, 11:09:00 AM2/11/14
to puppet...@googlegroups.com
Haha!! nice one!

Just a "r"

Shure...I copied it and didn't see...



Em terça-feira, 11 de fevereiro de 2014 13h46min10s UTC-2, bluethundr escreveu:

Rafael Cristaldo

unread,
Feb 11, 2014, 11:11:48 AM2/11/14
to puppet...@googlegroups.com
Hey
bluethundr

Just a Good Tip!

Every manifest created...use the

puppet parser validate <manifest.pp>

It will show you the Syntax Errors...

Em terça-feira, 11 de fevereiro de 2014 13h46min10s UTC-2, bluethundr escreveu:

Tim Dunphy

unread,
Feb 11, 2014, 11:19:18 AM2/11/14
to puppet...@googlegroups.com, puppet...@googlegroups.com
That's great advice!! Thank you!

Tim

Sent from my iPhone
--
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...@googlegroups.com.

Tim Dunphy

unread,
Feb 11, 2014, 11:20:22 AM2/11/14
to puppet...@googlegroups.com, puppet...@googlegroups.com
Once again great advice and will do! 

Tim

Sent from my iPhone
--
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...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages