puppet-sysctl icon indicating copy to clipboard operation
puppet-sysctl copied to clipboard

Enforce exec should find sysctl, test from path

Open jameslikeslinux opened this issue 8 years ago • 3 comments

On Gentoo, sysctl is in /usr/sbin, not /sbin, resulting in an error like:

Error: Could not find command '/sbin/sysctl'
Error: /Stage[main]/Sysctl[vm.min_free_kbytes]/Exec[enforce-sysctl-value-vm.min_free_kbytes]/returns: change from notrun

Other execs in this defined type use the path to find sysctl, so the enforce exec should as well.

This also fixes the indentation of the block to be consistent with the rest of the file.

jameslikeslinux avatar Jun 07 '16 03:06 jameslikeslinux

Until this is merged I did a workaround:

class gentoo_base::puppet_sysctl_path_workaround {
  # This is to work around https://github.com/thias/puppet-sysctl/pull/43 until it's merged
  file { '/sbin/sysctl':
    ensure => link,
    target => '/usr/sbin/sysctl',
    replace => false,
  } ->
  Class['sysctl::base']
  # To remove it later
  # exec { 'rm /sbin/sysctl':
  #   onlyif => 'test -L /sbin/sysctl',
  # }
}

Can we merge it please?

tobiaspal avatar Jun 29 '16 05:06 tobiaspal

Encountered this one as well. A merge would be nice.

ntnn avatar Jan 31 '17 02:01 ntnn

This fix is working and can be merged :+1:

saz avatar Jun 29 '17 08:06 saz