Sébastien Aperghis-Tramoni > RackMan-1.14 > rack

Download:
RackMan-1.14.tar.gz

Annotate this POD

CPAN RT

Open  1
View/Report Bugs
Source   Latest Release: RackMan-1.18

NAME ^

rack - Fetch information and generate config files for RackObjects

SYNOPSIS ^

    rack [--config /etc/rack.conf] <action> <action options> <object>
    rack { --help | --man | --version }

OPTIONS ^

Standard options

-c, --config path

Specify the path to the configuration file. Default to /etc/rack.conf

-v, --verbose

Run the program in verbose mode.

Program options

--device-login username

Specify an alternate login for connecting onto the device.

--device-password password

Specify an alternate password for connecting onto the device.

--dhcp-template path

Specify an alternate template path for RackMan::Format::DHCP.

-F, --formats list of formats

Specify a comma-separated list of formats, overriding the corresponding [device:*]/formats parameters in rack.conf

--ks, --kickstart-template path

Specify an alternate template path for RackMan::Format::Kickstart.

--no-write-device-config

Do not write the device specific file of the given RackObject.

-G, --only-formats list of formats

Alias for the --formats and --no-write-device-config options.

-o, --output path

Specify the path of the output file for the Generic format.

--pxe-template path

Specify an alternate template path for RackMan::Format::PXE.

--read-community community

Specify an alternate SNMP read community.

-S, --scm

Use a SCM program to version generated files. Enabled by default (use --no-scm to disable).

-t, --template path

Specify the path of the template file for the Generic format.

--write-community community

Specify an alternate SNMP write community.

Help options

-h, --help

Print a short usage description, then exit.

--man

Print the manual page of the program, then exit.

-V, --version

Print the program name and version, then exit.

ARGUMENTS ^

Arguments are expected to be:

DESCRIPTION ^

rack is a command for fetching information from a RackTables database about selected RackObjects, generate the corresponding configuration files and talk with the corresponding devices to set them up accordingly.

ACTIONS ^

list

Print the list of RackObjects of the given type (server, pdu, switch or all)

Options

  • as - specify the format: ldif, simple (default)
info

Print information about the RackObject

dump

Print the structure of the RackObject

Options

  • as - specify the format: json, ldif, perl, yaml (default)
diff

Print the differences between the actual and expected configuration of the device. Set exit status to 1 if there are differences, 0 otherwise.

write

Generate and write the configuration files corresponding to the RackObject

push

Push the configuration to the device corresponding to the RackObject.

EXAMPLES ^

List all the PDUs:

    rack list pdu

List all the servers in LDIF format:

    rack list servers as ldif

Print information about "front01.example.com" in default format (YAML):

    rack info front01.example.com

Dump information about "front01.example.com" in JSON format:

    rack dump as json front01.example.com
    rack dump front01.example.com as json

Write all the configuration files for "front01.example.com":

    rack write frontal01.example.com

Only write the DHCP file for "front01.example.com":

    rack write -G DHCP frontal01.example.com

Process the template input.tmpl with the information about "front01.example.com" and print the result on screen:

    rack write -G Generic -t input.tmpl frontal01.example.com

Process the template input.tmpl with the information about "front01.example.com" and write the result on disk, in a file named after the device:

    rack write -G Generic -t input.tmpl -o %name%.conf frontal01.example.com

CONFIGURATION ^

The configuration file is expected to be in the .INI format, with the following sections and parameters.

All parameters can be overridden in a per-device file named rack.local.conf, read from [general]/path (read below).

Parameters can contain placeholders that will be replaced with values corresponding to the given RackObjet:

Section [general]

Section [database]

Section [device:pdu]

Section [device:pdu:apc_rackpdu]

Section [device:server]

Section [device:server:hp_proliant]

Section [device:switch]

Section [device:switch:cisco_catalyst]

Section [format:bacula]

Section [format:cacti]

Section [format:dhcp]

Section [format:kickstart]

Section [format:ldap]

Section [format:nagios]

Section [format:pxe]

AUTHOR ^

Sebastien Aperghis-Tramoni (sebastien@aperghis.net)

syntax highlighting: