Adoptable Cookbooks List

Looking for a cookbook to adopt? You can now see a list of cookbooks available for adoption!
List of Adoptable Cookbooks

Supermarket Belongs to the Community

Supermarket belongs to the community. While Chef has the responsibility to keep it running and be stewards of its functionality, what it does and how it works is driven by the community. The chef/supermarket repository will continue to be where development of the Supermarket application takes place. Come be part of shaping the direction of Supermarket by opening issues and pull requests or by joining us on the Chef Mailing List.

Select Badges

Select Supported Platforms

Select Status

RSS

ilo (6) Versions 1.0.1

Configure HPE iLO

Policyfile
Berkshelf
Knife
cookbook 'ilo', '= 1.0.1', :supermarket
cookbook 'ilo', '= 1.0.1'
knife supermarket install ilo
knife supermarket download ilo
README
Dependencies
Changelog
Quality 0%

iLO Cookbook

Cookbook Version

Enables configuration of HPE iLOs via their APIs.

Requirements

  • Chef 12+
  • iLO 4

Cookbook Dependencies

  • compat_resource

How to use the iLO Cookbook:

This cookbook is not intended to include any recipes.
Use it by specifying a dependency on this cookbook in your own cookbook.

# my_cookbook/metadata.rb
...
depends 'ilo'

Now you can use the resources this cookbook provides. See below for some examples.

iLO Authentication

Each of the resources below requires you to pass in the info necessary to connect with the iLO API.
The basic structure accepted by the ilos property is an array of hashes (or ILO_SDK::Client objects):

ilos = [
  {
    host: 'ilo1.example.com',  # Required. IP or hostname
    user: 'Administrator',     # Optional. Defaults to 'Administrator'
    password: 'secret123'      # Required
    ssl_enabled: false         # Optional
  },
  {
    host: '10.0.0.3',
    user: 'User2',
    password: 'secret456'
  }
]

This array can be built using a variety of different sources, including [encrypted] databags, attributes, or read from json or yaml files.
For example:

# Set directly in recipe:
ilo_list1 = []
ilo_list1.push { host: 'ilo1.example.com', user: 'Administrator', password: 'secret123' }

# Read from data_bag:
ilo_list2 = data_bag_item('ilo_secrets', 'data_center_1')

# Load from yaml file:
ilo_list3 = YAML.load_file('/root/ilo_secrets.yml')

iLO Resources

The following resources are available for usage in your recipes:

ilo_account_service

  • Create User:
  ilo_account_service 'user create' do
    ilos [ilo1, ilo2]
    username 'test'
    password 'password123'
    action :create
  end
  • Delete User:
  ilo_account_service 'user delete' do
    ilos [ilo1, ilo2]
    username 'test'
    action :delete
  end
  • Update User Password:
  ilo_account_service 'update user password' do
    ilos [ilo1, ilo2]
    username 'test'
    password 'newpassword123'
    action :changePassword
  end

ilo_bios

  • Revert to default BIOS base configuration:
  ilo_bios 'revert BIOS' do
    ilos [ilo1, ilo2]
    action :revert
  end
  • Set BIOS configuration:
  ilo_bios 'set BIOS configuration' do
    ilos [ilo1, ilo2]
    uefi_shell_startup 'Enabled'
    uefi_shell_startup_location 'Auto'
    uefi_shell_startup_url 'http://www.uefi.nsh'
    dhcpv4 'Disabled'
    ipv4_address '10.1.1.0'
    ipv4_gateway '10.1.1.11'
    ipv4_primary_dns '10.1.1.1'
    ipv4_secondary_dns '10.1.1.2'
    ipv4_subnet_mask '255.255.255.0'
    url_boot_file 'http://www.urlbootfile.iso'
    service_name 'John Doe'
    service_email 'john.doe@hpe.com'
    action :set
  end

ilo_boot_settings

  • Revert to default Boot base configuration:
  ilo_boot_settings 'revert boot' do
    ilos [ilo1, ilo2]
    action :revert
  end
  • Set boot configuration:
  ilo_boot_settings 'set boot configuration' do
    ilos [ilo1, ilo2]
    boot_order [
      "FD.Virtual.1.1",
      "Generic.USB.1.1",
      "HD.Emb.1.1",
      "HD.Emb.1.2",
      "NIC.LOM.1.1.IPv4",
      "NIC.LOM.1.1.IPv6"
    ]
    boot_target 'None'
    action :set
  end
  • Dump the boot configuration to a file:
  ilo_boot_settings 'dump boot configuration' do
    ilos [ilo1, ilo2]
    owner 'JohnDoe'
    group 'Administrators'
    action :dump
  end

ilo_chassis

  • Dump power metrics and thermal metrics information to a file:
  ilo_chassis 'dump power metrics and thermal metrics' do
    ilos [ilo1, ilo2]
    power_metrics_file 'power_metrics.txt'
    thermal_metrics_file 'thermal_metrics.txt'
    owner 'JohnDoe'
    group 'Administrators'
    action :dump
  end

ilo_computer_details

  • Dump computer details to a file and data bag:
  ilo_computer_details 'dump computer details' do
    ilos [ilo1, ilo2]
    dump_file 'computer_details.txt'
    data_bag 'computer_details_bag'
    owner 'JohnDoe'
    group 'Administrators'
    action :dump
  end

ilo_computer_system

  • Set computer system information:
  ilo_computer_system 'set computer system info' do
    ilos [ilo1, ilo2]
    asset_tag 'HPE001'
    led_state 'Lit'
    action :set
  end

ilo_date_time

  • Set the time zone:
  ilo_date_time 'set time zone' do
    ilos [ilo1, ilo2]
    time_zone 'Africa/Abidjan'
    action :set
  end
  • Set whether or not to use NTP:
  ilo_date_time 'use NTP' do
    ilos [ilo1, ilo2]
    use_ntp true
    action :set_ntp
  end
  • Set the NTP servers:
  ilo_date_time 'set NTP servers' do
    ilos [ilo1, ilo2]
    ntp_servers [
      "10.168.0.2",
      "10.168.0.3"
    ]
    action :set_ntp_servers
  end

ilo_firmware_update

  • Upgrade firmware:
  ilo_date_time 'upgrade firmware' do
    ilos [ilo1, ilo2]
    fw_version '2.5'
    fw_uri 'www.firmwareuri.com'
    action :upgrade
  end

ilo_log_entry

  • Dump log entries to a file:
  ilo_log_entry 'dump log entries' do
    ilos [ilo1, ilo2]
    log_type 'IEL'
    dump_file 'IEL_logs.txt'
    owner 'JohnDoe'
    group 'Administrators'
    duration 30 # up to hours back from now
    action :dump
  end
  • Clear log entries:
  ilo_log_entry 'clear log entries' do
    ilos [ilo1, ilo2]
    log_type 'IEL'
    action :clear
  end

ilo_manager_network_protocol

  • Set ilo session timeout:
  ilo_manager_network_protocol 'set timeout' do
    ilos [ilo1, ilo2]
    timeout 60 # minutes
    action :set
  end

ilo_power

  • Power on the system:
  ilo_power 'power on' do
    ilos [ilo1, ilo2]
    action :poweron
  end
  • Power off the system:
  ilo_power 'power off' do
    ilos [ilo1, ilo2]
    action :poweroff
  end
  • Reset the system:
  ilo_power 'reset system' do
    ilos [ilo1, ilo2]
    action :resetsys
  end
  • Reset ilo:
  ilo_power 'reset ilo' do
    ilos [ilo1, ilo2]
    action :resetilo
  end

ilo_secure_boot

  • Set whether or not to enable UEFI secure boot:
  ilo_secure_boot 'enable secure boot' do
    ilos [ilo1, ilo2]
    enable true
    action :set
  end

ilo_service_root

  • Dump schema and registry information to a file:
  ilo_service_root 'dump schema and registry' do
    ilos [ilo1, ilo2]
    schema_prefix 'Account'
    schema_file 'schema.txt'
    registry_prefix 'Base'
    registry_file 'registry.txt'
    owner 'JohnDoe'
    group 'Administrators'
    action :dump
  end

ilo_snmp_service

  • Configure SNMP service:
  ilo_snmp_service 'set snmp mode and turn alerts on' do
    ilos [ilo1, ilo2]
    snmp_mode 'Agentless'
    snmp_alerts true
    action :configure
  end

ilo_virtual_media

  • Insert virtual media:
  ilo_virtual_media 'insert virtual media' do
    ilos [ilo1, ilo2]
    iso_uri 'http://10.254.224.38:5000/ubuntu-15.04-desktop-amd64.iso'
    action :insert
  end
  • Eject virtual media:
  ilo_virtual_media 'eject virtual media' do
    ilos [ilo1, ilo2]
    action :eject
  end

Contributing & Feature Requests

Contributing: Please see [CONTRIBUTING.md](CONTRIBUTING.md) for more info.

Feature Requests: If you have a need that is not met by the current implementation, please let us know (via a new issue).
This feedback is crucial for us to deliver a useful product. Do not assume we have already thought of everything, because we assure you that is not the case.

License

This project is licensed under the Apache 2.0 license. Please see [LICENSE](LICENSE) for more info.

Testing

Please see [CONTRIBUTING.md](CONTRIBUTING.md) for more info.

Authors

Dependent cookbooks

compat_resource >= 0.0.0

Contingent cookbooks

There are no cookbooks that are contingent upon this one.

1.0.0

Initial release

1.0.1

Updated metadata.rb file

Collaborator Number Metric
            

1.0.1 failed this metric

Failure: Cookbook has 1 collaborators. A cookbook must have at least 2 collaborators to pass this metric.

Foodcritic Metric
            

1.0.1 failed this metric

FC023: Prefer conditional attributes: /tmp/8e285c20d217576199b0a8a8/ilo/resources/chassis.rb:35
FC023: Prefer conditional attributes: /tmp/8e285c20d217576199b0a8a8/ilo/resources/chassis.rb:42
FC023: Prefer conditional attributes: /tmp/8e285c20d217576199b0a8a8/ilo/resources/computer_details.rb:34
FC023: Prefer conditional attributes: /tmp/8e285c20d217576199b0a8a8/ilo/resources/computer_system.rb:30
FC023: Prefer conditional attributes: /tmp/8e285c20d217576199b0a8a8/ilo/resources/computer_system.rb:35
FC023: Prefer conditional attributes: /tmp/8e285c20d217576199b0a8a8/ilo/resources/service_root.rb:40
FC023: Prefer conditional attributes: /tmp/8e285c20d217576199b0a8a8/ilo/resources/service_root.rb:47