NAME

Slaughter::API::linux - Perl Automation Tool Helper Linux implementation

SYNOPSIS

This module is the one that gets loaded upon Linux systems, after the generic API implementation. It implements the platform-specific parts of our primitives.

We also attempt to load Slaughter::API::Local::linux, where site-specific primitives may be implemented. If the loading of this additional module fails we report no error/warning.

AUTHOR

Steve
--
http://www.steve.org.uk/

LICENSE

Copyright (c) 2010-2012 by Steve Kemp. All rights reserved.

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The LICENSE file contains the full text of the license.

InstallPackage

The InstallPackage primitive will allow you to install a system package.

Currently apt-get and yum are supported, via Slaughter::Packages::linux.

foreach my $package ( qw! bash tcsh ! )
{
    if ( PackageInstalled( Package => $package ) )
    {
        print "$package installed\n";
    }
    else
    {
        InstallPackage( Package => $package );
    }
}

The following parameters are available:

Package [mandatory]

The name of the package to install.

PackageInstalled

Test whether a given system package is installed.

if ( PackageInstalled( Package => "exim4-config" ) )
{
    print "$package installed\n";
}

The following parameters are supported:

Package

The name of the package to test.

The return value will be a 0 if not installed, or 1 if it is.

Currently apt-get and yum are supported, via Slaughter::Packages::linux.

RemovePackage

Remove the specified system package from the system.

if ( PackageInstalled( Package => 'telnetd' ) )
{
    RemovePackage( Package => 'telnetd' );
}

The following parameters are supported:

Package

The name of the package to remove.

Currently apt-get and yum are supported, via Slaughter::Packages::linux.

UserCreate

Create a new user for the system.

# TODO

The following parameters are required:

Login

The username to create.

UID

The UID for the user.

GID

The primary GID for the user.

You may optionally specify the GCos field to use.