Jan Gehring > Rex > Rex::Commands::Sysctl

Download:
Rex-0.52.1.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  5
Open  1
View/Report Bugs
Module Version: 0.52.1   Source  

NAME ^

Rex::Commands::Sysctl - Manipulate sysctl

DESCRIPTION ^

With this module you can set and get sysctl parameters.

Version <= 1.0: All these functions will not be reported.

All these functions are not idempotent.

This function don't persists the entries in /etc/sysctl.conf.

SYNOPSIS ^

 use Rex::Commands::Sysctl;
 
 my $data = sysctl "net.ipv4.tcp_keepalive_time";
 sysctl "net.ipv4.tcp_keepalive_time" => 1800;

EXPORTED FUNCTIONS ^

sysctl($key [, $val])

This function will read the sysctl key $key.

If $val is given, then this function will set the sysctl key $key.

 task "tune", "server01", sub {
   if( sysctl("net.ipv4.ip_forward") == 0 ) {
     sysctl "net.ipv4.ip_forward" => 1;
   }
 };
syntax highlighting: