[Puppet Users] Puppet module 'issue' with sysctl provider (augeasproviders)

Stefan Heijmans
Thu, 19 Jun 2014 12:12:24 -0000

Hello,

I've got 'something strange' with a Puppet module, using
augeasproviders
(v1.2.0 or master branch of today) on Puppet 3.6.2
Below a stripped version of it with the same results as the full version;

It installs an Oracle preinstall rpm which also updates /etc/sysctl.conf
settings and use augeasproviders sysctl resource to watch these settings.

Puppet module with all resources in 1 file
==========================================
init:pp
======class oracle_t {
  include single
}

install.pp
=========class oracle_t::single {
  package { 'oracle-rdbms-server-11gR2-preinstall':
    ensure => present,
  }
  sysctl { 'kernel.shmall':
    ensure  => present,
    value   => '1073741824',
    require => Package['oracle-rdbms-server-11gR2-preinstall'],
  }
  sysctl { 'kernel.sem':
    ensure  => present,
    value   => '250 32000 100 128',
    require => Package['oracle-rdbms-server-11gR2-preinstall'],
  }
}

Before; /etc/sysctl.conf
-rw-r--r--. 1 root root 1327 Jun 19 12:49 /etc/sysctl.conf

kernel.core_uses_pid = 1
kernel.msgmax = 65536
kernel.msgmnb = 65536
kernel.shmall = 4294967296
kernel.shmmax = 68719476736
kernel.sysrq = 1
net.ipv4.conf.default.accept_source_route = 0
net.ipv4.conf.default.rp_filter = 1
net.ipv4.ip_forward = 0
net.ipv4.tcp_syncookies = 1
net.ipv6.conf.all.disable_ipv6 = 1

kernel.sem is *not* available in /etc/sysctl.conf
kernel.shmall is available in /etc/sysctl.conf
kernel.shmall = 4294967296

Puppet run;
Info: Applying configuration version '1403175278'
Notice:
/Stage[main]/Oracle_t::Single/Package[oracle-rdbms-server-11gR2-preinstall]/ensure:
created
Notice: Finished catalog run in 55.02 seconds

After; /etc/sysctl.conf
-rw-r--r--. 1 root root 2679 Jun 19 12:54 /etc/sysctl.conf

fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.core_uses_pid = 1
kernel.msgmax = 65536
kernel.msgmnb = 65536
kernel.sem = 250 32000 100 128
kernel.shmall = 1073741824
kernel.shmmax = 4398046511104
kernel.shmmni = 4096
kernel.sysrq = 1
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
net.ipv4.conf.default.accept_source_route = 0
net.ipv4.conf.default.rp_filter = 1
net.ipv4.ip_forward = 0
net.ipv4.ip_local_port_range = 9000 65500
net.ipv4.tcp_syncookies = 1
net.ipv6.conf.all.disable_ipv6 = 1

kernel.sem is available in /etc/sysctl.conf
kernel.sem = 250 32000 100 128
kernel.shmall is available in /etc/sysctl.conf
kernel.shmall = 1073741824

Now I remove the rpm and use this module;

Puppet module with all resources in 2 files
==========================================
init:pp
======class oracle_t {
  include install, sysctl
}

install.pp
=========class oracle_t::install {
  package { 'oracle-rdbms-server-11gR2-preinstall':
    ensure => present,
  }
}

sysctl.pp
========class oracle_t::sysctl {
  sysctl { 'kernel.shmall':
    ensure  => present,
    value   => '1073741824',
    require => Package['oracle-rdbms-server-11gR2-preinstall'],
  }
  sysctl { 'kernel.sem':
    ensure  => present,
    value   => '250 32000 100 128',
    require => Package['oracle-rdbms-server-11gR2-preinstall'],
  }
}

Before: /etc/sysctl.conf
-rw-r--r--. 1 root root 1327 Jun 19 13:03 /etc/sysctl.conf

kernel.core_uses_pid = 1
kernel.msgmax = 65536
kernel.msgmnb = 65536
kernel.shmall = 4294967296
kernel.shmmax = 68719476736
kernel.sysrq = 1
net.ipv4.conf.default.accept_source_route = 0
net.ipv4.conf.default.rp_filter = 1
net.ipv4.ip_forward = 0
net.ipv4.tcp_syncookies = 1
net.ipv6.conf.all.disable_ipv6 = 1

kernel.sem is *not* available in /etc/sysctl.conf
kernel.shmall is available in /etc/sysctl.conf
kernel.shmall = 4294967296

puppet run;
Info: Applying configuration version '1403175921'
Notice:
/Stage[main]/Oracle_t::Install/Package[oracle-rdbms-server-11gR2-preinstall]/ensure:
created
Notice: /Stage[main]/Oracle_t::Sysctl/Sysctl[kernel.shmall]/value: changed
configuration value from '4294967296' to '1073741824'
Notice: /Stage[main]/Oracle_t::Sysctl/Sysctl[kernel.sem]/ensure: created
Notice: Finished catalog run in 46.29 seconds

After; /etc/sysctl.conf
-rw-r--r--. 1 root root 1358 Jun 19 13:05 /etc/sysctl.conf

kernel.core_uses_pid = 1
kernel.msgmax = 65536
kernel.msgmnb = 65536
kernel.sem = 250 32000 100 128
kernel.shmall = 1073741824
kernel.shmmax = 68719476736
kernel.sysrq = 1
net.ipv4.conf.default.accept_source_route = 0
net.ipv4.conf.default.rp_filter = 1
net.ipv4.ip_forward = 0
net.ipv4.tcp_syncookies = 1
net.ipv6.conf.all.disable_ipv6 = 1

kernel.sem is available in /etc/sysctl.conf
kernel.sem = 250 32000 100 128
kernel.shmall is available in /etc/sysctl.conf
kernel.shmall = 1073741824


So,
with Puppet module and resources in 1 file;
- sysctl resources are not set
- /etc/sysctl.conf updates from the rpm are there

with Puppet module and resources in 2 files;
- sysctl resources are set
- /etc/sysctl.conf updates from rpm are somehow removed

And I have no idea why :(

Thanks,
Stefan

--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to puppet-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/puppet-users/61fb32c3-ce5c-4859-b20c-94580e144321%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.