Skip to content

Puppet type for controlling the bmc as well as other useful facts

License

Notifications You must be signed in to change notification settings

logicminds/bmclib

Repository files navigation

Build Status

#bmclib

####Table of Contents

  1. Overview
  2. Module Description - What the module does and why it is useful
  3. Setup - The basics of getting started with bmclib
  4. Usage - Configuration options and additional functionality
  5. Reference - An under-the-hood peek at what the module is doing and how
  6. Limitations - OS compatibility, etc.
  7. Development - Guide for contributing to the module

##Overview The BMClib is a puppet module that lets you provision your ipmi devices using a native type.

##Module Description The bmclib puppet module provides a native type and provider that helps you provision your ipmi devices and users on your ipmi device. It uses openipmi to configure your device which if performed on the system as root does not require any authentication. Because no authentication is required, ipmi devices can be programmed automatically with puppet. Additionally, I have provided several helpful custom facts that detail if the device is present and some of the networking configuration around your bmc device.

##Setup

###What bmclib affects

  • The impi device on your server, which you should only have one of.
  • Installs openipmi and starts the openipmi service
  • Note: Vitural Machines are not supported because they do not have any ipmi devices to configure.

###Setup Requirements

  • Requires a BMC device compatible with IPMI specifications.
  • ipmitool installed
  • openimpi installed and running

###Beginning with bmclib

I have created a puppet class to assist with installing the openipmi driver and ipmitool, but your not required to use this class if you already have something working. Without openipmi working on your puppet managed system, the facts and providers will not be available.

include 'bmclib'     

##Usage

include 'bmclib'
bmc { '78:e7:d1:7d:20:cc':
  ensure   => 'present',
  gateway  => '192.168.1.1',
  ip       => '192.168.1.25',
  ipsource => 'static',
  netmask  => '255.255.255.0',
  vlanid   => 'off',
  require  => Class['bmclib']
}
bmcuser { 'bmcuser'
  ensure    => enabled,
  privlevel => 'admin',
  username  => 'username',
  userpass  => 'userpass',
  force     => true,
  require   => Class['bmclib'],
}

##Reference

Facts provided:

  • bmc_gateway => 192.168.1.1
  • bmc_ip => 192.168.1.41
  • bmc_mac => 00:17:A4:49:AB:70
  • bmc_subnet => 255.255.255.0
  • bmc_device_present => false or true
  • bmc_tools_present => false or true
   if not $::bmc_device_present {
      exec{"Purchase better hardware":
        command => 'echo "We need better hardware boss! | mail -s "help us!" [email protected]'
      }
   }

Types Provided

  • bmcuser (adds user to bmc device)
  • bmc (configures bmc device on network)

Using the Puppet Ral

[root@g6 bmclib]# puppet resource bmc
bmc { '78:e7:d1:7d:20:cc':
  ensure   => 'present',
  gateway  => '192.168.1.1',
  ip       => '192.168.1.25',
  ipsource => 'static',
  netmask  => '255.255.255.0',
  vlanid   => 'off',
}
[root@g6 bmclib]# puppet resource bmcuser
bmcuser { 'Administrator':
  ensure    => 'present',
  id        => '1',
  privlevel => 'ADMINISTRATOR',
  userpass  => '*************',
}
bmcuser { 'admin':
  ensure    => 'present',
  id        => '2',
  privlevel => 'ADMINISTRATOR',
  userpass  => '*************',
}

Providers Available

  • ipmitool

Parameters for bmc type

  • provider: if left blank will default to ipmitool
  • ensure : enabled, present, disabled
  • vlanid :the vlan the bmc interface should communicate on (optional)
  • ip: the ip address of the bmc device (required)
  • netmask:the netmask of the bmc device (required)
  • gateway: the gateway of the bmc device (required)
  • snmp:the snmp public community string for the bmc device

Parameters for bmcuser type

  • provider: if left blank will default to ipmitool
  • ensure : enabled, present, disabled
  • privlevel :the privilage level of the bmc user
  • username: username of bmc user to add
  • userpass: the password of the bmc user to add
  • force: force set the parameters during each puppet run

##Limitations Works on *nix systems or whatever can run openipmi and ipmitool. Not all linux operating systems are listed in the support metadata. YMMV.

Currently the output will show sensitive information when using bmcuser: Notice: /Stage[main]/Main/Bmcuser[testuser]/userpass: userpass changed '**Hidden**' to 'password'

Contributors

  • Corey Osman [email protected] (Original Author)
  • Mike Arnold
  • Kyle Anderson
  • Tomas Doran
  • Barak Korren
  • Fred Hatfull
  • James McGuinness

##Development

Testing

To begin you need to run:

  • rake spec

About

Puppet type for controlling the bmc as well as other useful facts

Resources

License

Stars

Watchers

Forks

Packages

No packages published