The Puppet Labs Issue Tracker has Moved: https://tickets.puppetlabs.com

Bug #12653

schedule metaparameter ignored in defined type

Added by Chip Schweiss over 2 years ago. Updated 9 months ago.

Status:Needs More InformationStart date:02/15/2012
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:metaparameters
Target version:-
Affected Puppet version:2.6.12 Branch:
Keywords:define, schedule

We've Moved!

Ticket tracking is now hosted in JIRA: https://tickets.puppetlabs.com

This ticket may be automatically exported to the PUP project on JIRA using the button below:


Description

I have defined:

define yumgroup($ensure = "present", $optional = false) {
    case $ensure {
        present,installed: {
            $pkg_types_arg = $optional ? {
                true => "--setopt=group_package_types=optional,default,mandatory",
                default => ""
            }
            exec { "Installing $name yum group":
                command => "yum -y groupinstall $pkg_types_arg $name",
                unless => "yum -y groupinstall $pkg_types_arg $name --downloadonly",
                timeout => 600,
                require => Package["yum-plugin-downloadonly"];
            }
        }
    }
}   

and call it with:

yumgroup {
    $centos6_pkg_groups:
    ensure => present,
    schedule => 'daily',
}

The schedule is ignored and runs every time. If I add the schedule to the exec in the defined method it works as expected.

12653.pp (1.03 KB) Chris Price, 02/21/2012 01:38 pm

History

#1 Updated by Chris Price over 2 years ago

  • Status changed from Unreviewed to Investigating
  • Assignee set to Chris Price

#2 Updated by Chris Price over 2 years ago

  • File 12653.pp added
  • Status changed from Investigating to Needs More Information
  • Assignee deleted (Chris Price)

Spent a little while trying to reproduce this, and didn’t have success.

I’ve attached a little manifest that shows some “schedule” metaparams working successfully with “defines”. In one of the defines I used a case statement, wondering if that could be what was causing your issue. They all seem to be behaving just as I’d expect.

I’ve tested this with 2.6.12 and master.

Perhaps you could experiment with this manifest and let us know whether it works for you? If it does, then perhaps there is still something different that your manifest is triggering that I didn’t tickle with this one.

#3 Updated by John Julien over 1 year ago

This bug appears to only trigger when the schedule and define are part of a class rather than an in-line manifest like the one Chris attached.

The schedule is ignored in the following code (Tested on 2.7.16):

class myclass {
  schedule { 'never':
    period => never,
  }

  define foodefine::sub ($foomessage) {
    notify { "FOODEFINE: $name $foomessage": }
  }

  foodefine::sub { "should not execute":
    foomessage => 'never',
    schedule => 'never',
  }
}

include myclass

#4 Updated by Jan Doleschal 9 months ago

Hello,

the Bug occurs in puppet 3.2.4 too.

Also available in: Atom PDF