Note that a workaround is to override the schedule for each package that is depended on this way, but that prevents application of "ensure => latest". Which brings up a really good point. What if I want to install software at any hour, but only update the same software during certain hours? The current Package resource doesn't seem capable of this, especially since There Can Be Only One :(
On Nov 8, 2012, at 2:42 PM, Jo Rhett wrote: > If you setup a schedule such that packages are only installed certain hours > of the day, well, that part works. They won't install until that time. > However, if you have a policy that depends on the package being installed, if > it is NOT installed due to the schedule, it satisfies the Require and > everything else happens. I'm going to call this misfeature: "No package? No > Problem! ":( > > Example: with this example, if you apply the policy after 8pm (if you are > using UTC like we are, that's noon PST) then it will actually install the > configuration files and attempt to start the service. This is clearly a bug. > Given some multi-application interactions, this could cause a major service > outage. (I didn't find this with snmp but instead with some inhouse system > components. I replicated it with this config before reporting it) > > I observed this on 2.7.19 but checking the sources it appears likely to be a > problem with 3.0 as well. > > site.pp: > # Schedule in the early part of the working day (not peak) > schedule { 'early-day': > range => '17 - 20', > period => daily, > periodmatch => number, > } > Package { > schedule => 'early-day', > } > node default { > class { snmpd: } > } > > class snmpd { > package { 'net-snmp': > ensure => present, > alias => 'snmpd', > } > package { 'net-snmp-perl': > ensure => present, > require => Package['net-snmp'], > } > file { "/etc/sysconfig/snmpd": > owner => root, > group => root, > mode => 0755, > source => 'puppet:///modules/snmpd/snmpd.sysconfig', > require => Package['net-snmp'], > notify => Service['snmpd'], > } > file { '/etc/snmp/snmpd.conf': > ensure => file, > owner => root, > group => root, > mode => 0755, > content => template('snmpd/snmpd.conf'), > require => Package['net-snmp'], > notify => Service['snmpd'], > } > service { 'snmpd': > ensure => running, > enable => true, > require => Package['net-snmp','net-snmp-perl'], > } > } > > -- > Jo Rhett > Net Consonance : net philanthropy to improve open source and internet > projects. > > > > -- > You received this message because you are subscribed to the Google Groups > "Puppet Users" group. > To post to this group, send email to puppet-users@googlegroups.com. > To unsubscribe from this group, send email to > puppet-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/puppet-users?hl=en. > -- Jo Rhett Net Consonance : net philanthropy to improve open source and internet projects. -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.