saz / puppet-sudo

Manage sudo with Puppet on Debian-, RedHat- and SUSE-based linux distributions and some BSDs
Other
105 stars 215 forks source link

Priority should be zero-padded #109

Closed janfabry closed 9 years ago

janfabry commented 9 years ago

The priority part of the filename should be zero-padded, otherwise a config with priority => 5 will lexically come after one with priority => 10.

sudo::conf { 'high-prio':
  priority => 5,
  content => '# This is high prio',
}

sudo ::conf { 'normal-prio':
  content => '# This is normal prio',
}

Will result in: 10_normal-prio, 5_high-prio, while it should be 05_high-prio, 10_normal-prio.

This is also mentioned in the man pages:

Be aware that because the sorting is lexical, not numeric, /etc/sudoers.d/1_whoops would be loaded after /etc/sudoers.d/10_second. Using a consistent number of leading zeroes in the file names can be used to avoid such problems.