Issue #13975 has been reported by Ian Orszaczki.

----------------------------------------
Bug #13975: onlyifs and unlesses running when refreshonly in class
https://projects.puppetlabs.com/issues/13975

Author: Ian Orszaczki
Status: Unreviewed
Priority: Normal
Assignee: 
Category: 
Target version: 
Affected Puppet version: 2.7.1
Keywords: onlyif refreshonly
Branch: 


only ifs and refreshonlys behave differently when in a class. They appear to be


as a class -

init.pp -
# Class: badrefresh
#
# This module manages badrefresh
#
# Parameters:
#
# Actions:
#
# Requires:
#
# Sample Usage:
#
# [Remember: No empty lines between comments and class definition]
class badrefresh {


   exec { 'neverruns':
      onlyif      => '/bin/true',
      command     => '/bin/echo xxx',
      unless      => '/bin/false',
      refreshonly => true,
      logoutput   => true,
    }
}

# puppet apply -v -e 'include badrefresh' -d
....
.....
info: Applying configuration version '1332325017'
debug: /Schedule[daily]: Skipping device resources because running on a host
debug: /Schedule[monthly]: Skipping device resources because running on a host
debug: /Schedule[hourly]: Skipping device resources because running on a host
debug: /Schedule[never]: Skipping device resources because running on a host
debug: Exec[neverruns](provider=posix): Executing check '/bin/true'
debug: Executing '/bin/true'
debug: Exec[neverruns](provider=posix): Executing check '/bin/false'
debug: Executing '/bin/false'
debug: /Schedule[weekly]: Skipping device resources because running on a host
debug: /Schedule[puppet]: Skipping device resources because running on a host
debug: Finishing transaction -607221868
debug: Storing state
debug: Stored state in 0.06 seconds
notice: Finished catalog run in 0.24 seconds

not in a class -

badrefresh.pp -
   exec { 'neverruns':
      onlyif      => '/bin/true',
      command     => '/bin/echo xxx',
      unless      => '/bin/false',
      refreshonly => true,
      logoutput   => true,
    }

# puppet apply -v badrefresh.pp -d

info: Applying configuration version '1332325109'
debug: /Schedule[daily]: Skipping device resources because running on a host
debug: /Schedule[monthly]: Skipping device resources because running on a host
debug: /Schedule[hourly]: Skipping device resources because running on a host
debug: /Schedule[never]: Skipping device resources because running on a host
debug: /Schedule[weekly]: Skipping device resources because running on a host
debug: /Schedule[puppet]: Skipping device resources because running on a host
debug: Finishing transaction -607549908
debug: Storing state
debug: Stored state in 0.05 seconds
notice: Finished catalog run in 0.12 seconds


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en.

Reply via email to