Sha256: 22fe5db7f248f1671683365d5b0ca0fec44c92fcd2ddea2042959b1684be8eeb

Contents?: true

Size: 1.32 KB

Versions: 11

Compression:

Stored size: 1.32 KB

Contents

module Rubyipmi::Ipmitool

  class ChassisConfig < Rubyipmi::Ipmitool::BaseCommand

    def initialize(opts = ObservableHash.new)
      super("ipmitool", opts)

    end

    # Get the current boot device
    def bootdevice
       # Not available with ipmitool
       false
    end

    # Set the boot device
    def bootdevice(device, persistent=false)
      if persistent
        @options["cmdargs"] = "chassis bootdev #{device}"
      else
        @options["cmdargs"] = "chassis bootparam set bootflag force_#{device}"
      end
      value = runcmd
      @options.delete_notify("cmdargs")
      return value
    end

    # Get list of available boot devices
    def bootdevices
      # ideally we should get this list from the ipmidevice
      # However ipmitool only has a static list
      ["pxe", "disk", "safe", "diag", "cdrom", "bios", "floppy"]
    end

    # shortcut to set boot device to pxe
    def bootpxe(persistent=true)
      bootdevice("pxe",persistent)
    end

    # shortcut to set boot device to disk
    def bootdisk(persistent=true)
      bootdevice("disk",persistent)
    end

    # shortcut to set boot device to cdrom
    def bootcdrom(persistent=true)
      bootdevice("cdrom",persistent)
    end

    # shortcut to boot into bios setup
    def bootbios(persistent=true)
      bootdevice("bios",persistent)
    end

  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
rubyipmi-0.10.0 lib/rubyipmi/ipmitool/commands/chassisconfig.rb
rubyipmi-0.9.3 lib/rubyipmi/ipmitool/commands/chassisconfig.rb
rubyipmi-0.9.2 lib/rubyipmi/ipmitool/commands/chassisconfig.rb
rubyipmi-0.9.1 lib/rubyipmi/ipmitool/commands/chassisconfig.rb
rubyipmi-0.9.0 lib/rubyipmi/ipmitool/commands/chassisconfig.rb
rubyipmi-0.8.1 lib/rubyipmi/ipmitool/commands/chassisconfig.rb
rubyipmi-0.7.0 lib/rubyipmi/ipmitool/commands/chassisconfig.rb
rubyipmi-0.6.0 lib/rubyipmi/ipmitool/commands/chassisconfig.rb
rubyipmi-0.5.1 lib/rubyipmi/ipmitool/commands/chassisconfig.rb
rubyipmi-0.5.0 lib/rubyipmi/ipmitool/commands/chassisconfig.rb
rubyipmi-0.4.0 lib/rubyipmi/ipmitool/commands/chassisconfig.rb