I'm trying to configure APT to not install recommended packages. I'm using puppetforge puppetlabs/apt module so I wish to notify the Exec['apt_update'] resource from that module.

I'm using this:

  class init {

    include apt

    # Configure apt to not install recommends
    file { "/etc/apt/apt.conf.d/80mymodule-norecommends":
        ensure => present,
        owner => root,
        group => root,
        mode => 644,  
        source => "puppet:///modules/mymodule/apt/80mymodule-norecommends",
        notify => Exec['apt_update'],


However I get the following error:

Could not find dependent Exec[apt_update] for File[/etc/apt/apt.conf.d/80mymodule-norecommends] at /etc/puppet/modules/mymodule/manifests/apt.pp:18

I have tried several syntax options (like notify => Apt::Exec['apt_update'],) but I don't get why I can't notify that resource.

  • Weird. You can try notify => Class['apt::update'], but your code should work. – Felix Frank Jul 29 '14 at 0:39
  • Same: Could not find dependent Class[Apt::Update]. Seems that for some reason I cannot reach that scope, although "include apt" works. – jjmontes Jul 29 '14 at 8:22
  • Umm, you gave me a clue. My class is called "apt" too. The initial syntax seems to work if I replace include apt with include ::apt... – jjmontes Jul 29 '14 at 8:23
  • Oh, you have some apt class shadowing the one from the module. Yes, that is most unfortunate. – Felix Frank Jul 29 '14 at 16:21

As Felix said, I had some apt class shadowing the one from the module.

I replaced:

include apt


include ::apt

And the issue was fixed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.