should create_resources honor schedule metaparameter?

45 views
Skip to first unread message

Tom Downes

unread,
Sep 28, 2015, 11:17:31 PM9/28/15
to Puppet Users
I have a defined resource that I instantiate through create_resources and a set of defaults that trace back to hiera:

create_resources("apache::vhost", $full_apache_hash, $http_defaults)


http_defaults:

  schedule: 'nightly'

  priority: '25'

  docroot: '/var/www'

  serveradmin: 'myl...@dot.edu'

  port: '80'


Elsewhere in the catalog I have defined:


schedule { 'nightly':

  range  => '0-2',

  period => daily,

  repeat => 1,

}


When I run "puppet agent -t" outside of the specified range, it always takes action to manage my apache::vhost. i.e. if I blow away the file, it will come back. Am I wrong not to expect this? Is it create_resources not honoring schedule or puppet agent -t ignoring schedule?


Thanks,


Tom

jcbollinger

unread,
Sep 29, 2015, 9:35:32 AM9/29/15
to Puppet Users
There have been problems with create_resources() and other metaparameters in the past, but I think the consensus is that they should work together.  I see no reason or documentation that the 'schedule' metaparameter would be different.

Looking at the other side of the equation, there is a configuration setting 'ignoreschedules' whose effect on the agent is what its name indicates.  That setting is not documented to be included in '--test' / '-t', but perhaps it crept in there without being documented, or perhaps it is specified in your config file.  I'd try this command instead to see whether it behaves differently with respect to schedules:

puppet agent --onetime --no-daemonize --ignorecache --no-usecacheonfailure --no-ignoreschedules

Optionally, include also some or all of the flags --detailed-exitcodes --no-splay --show_diff', which are implied by --test.

If the schedule still is not honored then do make sure it is actually in the catalog the agent retrieves.  If so, then I call bug.


John

Tom Downes

unread,
Oct 2, 2015, 3:58:49 PM10/2/15
to Puppet Users
Hi - didn't seem to get the automatic update on this post. I'm going to have a member of my team check out your suggestion.

Tom
Reply all
Reply to author
Forward
0 new messages