Problems with sysctl module

Hi,

I've installed Foreman 1.2 on a Oracle Linux 6.4-box successfully and I'm
now trying to hook up something to control the sysctl-file on some boxes.
I've tried every sysctl-module on forge.puppetlabs.com but I can't get them
to work in Foreman. Can someone explain to me how I can create or add
custom Puppet Class parameters to control, for instance, the parameter
vm.swappiness? I can't get sysctl to work in Foreman.

Kind regards,
Andreas

Hello Andreas,

I think this is more Puppet related question, you should maybe consider
re-sending this to Puppet users list.

First of all, you should start with getting this done via plain puppet
first. I recommend to try your module locally via simple puppet apply
command.

If that works, move one step further and try with puppet master and
puppet agent.

Once this is working, you can then connect your master daemon to Foreman
using a smart proxy. Then you can use the Import button in the Puppet
Classes page to import our class and override parameters.

And after you import these, you can work with your class in Foreman.

See here: Foreman :: Manual

Unfortunately we don't have Best practices chapters in our manual that
would describe how to do setups. We assume you have existing puppet
infrastructure, or at least experience with it. It would be good idea to
have some document describing these.

··· -- Later,

Lukas “lzap” Zapletal
irc: lzap #theforeman

I expect that a sysctl module provides defined types or new resource
types, not classes. If so, these won't show up in Foreman as classes
you can add via the ENC. Instead, use them in your own Puppet classes
and add those classes via Foreman.

··· On 02/08/13 10:14, Andreas Dijkman wrote: > Hi, > > I've installed Foreman 1.2 on a Oracle Linux 6.4-box successfully and > I'm now trying to hook up something to control the sysctl-file on some > boxes. I've tried every sysctl-module on forge.puppetlabs.com but I > can't get them to work in Foreman. Can someone explain to me how I can > create or add custom Puppet Class parameters to control, for instance, > the parameter vm.swappiness? I can't get sysctl to work in Foreman.


Dominic Cleal
Red Hat Engineering

Good day.

Sorry for rising a dead thread but spending some time with foreman I
learned a few tricks. And I want to share it with public.

For this task I've used this module:
https://forge.puppetlabs.com/fiddyspence/sysctl

And create small foreman module which is called sysctl-wrapper and consist
of single class(file) sysctl-wrapper/manifests/init.pp:
class sysctl-wrapper (
$sysctlData = false,
) {
include sysctl

if $sysctlData != false {
    create_resources('sysctl', $sysctlData)
}

}

Next thing is to import it foreman and override $sysctlData variable with
yaml syntax.
Example:
net.ipv6.conf.all.disable_ipv6:
ensure: present
permanent: true
value: 1
net.ipv6.conf.default.disable_ipv6:
ensure: present
permanent: true
value: 1

Hope this will be useful to somebody.

Thanks,
Mikhail.

··· On Friday, August 2, 2013 1:14:36 PM UTC+4, Andreas Dijkman wrote: > > Hi, > > I've installed Foreman 1.2 on a Oracle Linux 6.4-box successfully and I'm > now trying to hook up something to control the sysctl-file on some boxes. > I've tried every sysctl-module on forge.puppetlabs.com but I can't get > them to work in Foreman. Can someone explain to me how I can create or add > custom Puppet Class parameters to control, for instance, the parameter > vm.swappiness? I can't get sysctl to work in Foreman. > > Kind regards, > Andreas >

Lukas,

I will try those steps. Any suggestions how to get it in a hierarchy, the
same way Foreman uses Host Groups and such?

Andreas

··· On Friday, August 2, 2013 12:56:48 PM UTC+2, Lukas Zapletal wrote: > > Hello Andreas, > > I think this is more Puppet related question, you should maybe consider > re-sending this to Puppet users list. > > First of all, you should start with getting this done via plain puppet > first. I recommend to try your module locally via simple puppet apply > command. > > If that works, move one step further and try with puppet master and > puppet agent. > > Once this is working, you can then connect your master daemon to Foreman > using a smart proxy. Then you can use the Import button in the Puppet > Classes page to import our class and override parameters. > > And after you import these, you can work with your class in Foreman. > > See here: http://theforeman.org/manuals/1.1/index.html#4.2ManagingPuppet > > Unfortunately we don't have Best practices chapters in our manual that > would describe how to do setups. We assume you have existing puppet > infrastructure, or at least experience with it. It would be good idea to > have some document describing these. > > -- > Later, > > Lukas "lzap" Zapletal > irc: lzap #theforeman >

I am afraid I don't understand the question. Can you re-prase?

··· On Fri, Aug 02, 2013 at 07:01:52AM -0700, Andreas Dijkman wrote: > I will try those steps. Any suggestions how to get it in a hierarchy, the > same way Foreman uses Host Groups and such?


Later,

Lukas “lzap” Zapletal
irc: lzap #theforeman