cookbook 'chef-ibmc-cookbook', '= 0.2.0'
chef-ibmc-cookbook (4) Versions 0.2.0 Follow0
Configure Huawei iBMC
cookbook 'chef-ibmc-cookbook', '= 0.2.0', :supermarket
knife supermarket install chef-ibmc-cookbook
knife supermarket download chef-ibmc-cookbook
chef-ibmc-cookbook Cookbook
This cookbook provides resources for configuring Huawei iBMC via their APIs. Included resources:
- BIOS Management(
ibmc_bios
) - Driver Management(
ibmc_driver
) - Firmware Management(
ibmc_firmware
) - System Health Management
- CPU Health(
ibmc_health_cpu
) - Drive Health(
ibmc_health_drive
) - Fan Health(
ibmc_health_fan
) - Memory Health(
ibmc_health_memory
) - Power Supply Health(
ibmc_health_psu
) - RAID Health(
ibmc_health_raid
)
- CPU Health(
- Indicator State of Chassis Management(
ibmc_led
) - License Management(
ibmc_license
) - DNS Management(
ibmc_network_dns
) - IPv4 Network Management(
ibmc_network_ipv4
) - IPv6 Network Management(
ibmc_network_ipv6
) - IP Version Management(
ibmc_network_ipversion
) - VLAN Management(
ibmc_network_vlan
) - Manager Ethernet Interface Management(
ibmc_network
) - NTP Service Management(
ibmc_ntp
) - Boot Management(
ibmc_os_boot
) - CPU Management(
ibmc_os_cpu
) - Physical Disk Management(
ibmc_os_drive
) - OS Ethernet Information Management(
ibmc_os_eth
) - Memory Management(
ibmc_os_memory
) - OS Power Management(
ibmc_os_power
) - Product Information Management(
ibmc_os_product
) - RAID Information Management(
ibmc_os_raid
) - OS Management(
ibmc_os
) - BMC Power Management(
ibmc_power
) - Network Service Management(
ibmc_service
) - SMTP Service Management(
ibmc_smtp
) - SNMP Service Management(
ibmc_snmp
) - SP Service Management(
ibmc_sp
) - User Management(
ibmc_user
) - Virtual Media Management(
ibmc_vm
)
Requirements
Platforms
- Ubuntu 14.04+
- CentOS 7+
Chef
- Chef 13.0+
Cookbooks
- none
How to use the iBMC Cookbook:
This cookbook is not intended to include any recipes. Use it by specifiying a dependency on this cookbook in your own cookbook.
# my_cookbook/metadata.rb ... depends 'chef-ibmc-cookbook'
Credentials
In order to use iBMC API, authentication credential needs to be present. There are 3 ways to handle this:
- Using resource parameters(highest precedence)
- Using attributes
- Using data bag(lowest precedence)
Using resource parameters
All iBMC custom resources have iBMC credential properties:
- ibmc_host
: String, iBMC host address
- ibmc_port
: Integer, iBMC port
- ibmc_username
: String, iBMC username
- ibmc_password
: String, iBMC password
ibmc_bios 'get bios' do ibmc_host 'ibmc-host' ibmc_port 443 ibmc_username 'ibmc-user' ibmc_password 'ibmc-pass' attribute 'bios-attribute' action :get end
Using attributes
Example Attributes:
```ruby
/attributes/default.rb
default['ibmc']['main'] = {
'host': 'ibmc-host',
'port': 443,
'username': 'ibmc-user',
'password': 'ibmc-pass'
}
```
Then, you can use iBMC custom resource like this:
ruby
ibmc_bios 'get bios' do
attribute 'bios-attribute'
action :get
end
Using data bag
Example Data Bag:
json
% knife data bag show ibmc main
{
"host": "ibmc-host",
"port": 443,
"username": "ibmc-user",
"password": "ibmc-pass"
}
Then you can use iBMC custom resource like this:
ibmc_bios 'get bios' do attribute 'bios-attribute' action :get end
Resources
All resource has no default action, so action must be set explicitly.
ibmc_bios
Manage BIOS
Actions:
-
get
: Get BIOS information.- Properties:
-
attribute
: String. Required.
BIOS attribute.
-
set
: Set BIOS attributes.- Properties:
-
attribute
: String. Required.
BIOS attribute.
-value
: String. Required.BIOS attribute value.
restore
: Restore BIOS default settings.
Examples:
ibmc_bios 'get' do attribute 'attribute-name' action :get end
ibmc_driver
Manage driver
Actions:
-
get
: Get driver.- Properties:
-
file
: String.
The loacl path of the configuration file.
-
upgrade
: Upgrade driver.- Properties:
-
image_uri
: String. Required.
Path of the upgrade package which can be IP/tmp/filename for a package on the BMC or IP/directory/filename for a package on a remote server.
-signature_uri
: String. Required.Path of the upgrade package digital signature file which can be IP/tmp/filename for a signature file on the BMC or IP/directory/filename for a signature file on a remote server.
-parameter
: String. Required.all
indicates the entire upgrade package or a specific upgrade package (for example package1.rpm).
-mode
: String. Required.Mode of the upgrade. Value could be
Auto
,Full
,Recover
,APP
orDriver
.
-active_method
: String. Required.How does the upgrade take effect. Value could be
OSRestart
orServerRestart
.
Examples:
ibmc_driver 'get' do action :get end ibmc_driver 'upgrade' do image_uri 'image uri' signature_uri 'signature uri' parameter 'all' mode 'Auto' active_method 'OSRestart' action :upgrade end
ibmc_firmware
Manage firmware
Actions:
-
get
: Get firmware.- Properties:
None
-
upgrade
: Upgrade firmware.- Properties:
-
image_uri
: String.
Path of the upgrade package on the a remote server. (e.g., protocol://username:password@ip/directory/filename. Supported protocols include https, scp, sftp, cifs and nfs.)
Examples:
ibmc_firmware 'get' do action :get end
ibmc_health_cpu
Manage CPU health
Actions:
-
get
: Get CPU health.- Properties:
None
Examples:
ibmc_health_cpu 'get' do action :get end
ibmc_health_drive
Manage drive health
Actions:
-
get
: Get drive health.- Properties:
-
drive_id
: Integer.
Driver identifier.
Examples:
ibmc_health_drive 'get' do action :get end
ibmc_health_fan
Manage fan health
Actions:
-
get
: Get fan health.- Properties:
None
Examples:
ibmc_health_fan 'get' do action :get end
ibmc_health_memory
Manage memory health
Actions:
-
get
: Get memory health.- Properties:
None
Examples:
ibmc_health_memory 'get' do action :get end
ibmc_health_psu
Manage power supply health
Actions:
-
get
: Get power supply health.- Properties:
None
Examples:
ibmc_health_psu 'get' do action :get end
ibmc_health_raid
Manage RAID health
Actions:
-
get
: Get RAID health.- Properties:
None
Examples:
ibmc_health_raid 'get' do action :get end
ibmc_led
Manage indicator state of chassis
Actions:
-
set
: Set indicator state of chassis.- Properties:
-
state
: String. Required.
Indicator state of chassis. Value could be
Lit
,Off
orBlinking
.
Examples:
ibmc_led 'light up' do set 'Lit' action :set end
ibmc_license
Manage iBMC license
Actions:
-
install
: Install license.- Properties:
-
source
: String. DefaultiBMC
. Required.
License source. Value could be
iBMC
,FusionDirector
oreSight
.
-type
: String. Required.Content type. Value could be
URI
orText
.
-content
: String. Required.Content of license. License text content if
type
isText
while license file uri iftype
isURI
. -
export
: Export license.- Properties:
-
export_to
: String. Required.
The license file URI to be export to.
-
delete
: Delete license.- Properties:
None
Examples:
ibmc_license 'install' do type 'URI' content 'License URI' action :install end
ibmc_network_dns
Manage DNS
Actions:
-
set
: Set DNS information.- Properties:
-
address_origin
: String.
How DNS server information is obtained. Value coule be
Static
,IPv4
orIPv6
.
-hostname
: String.iBMC hostname.
-domain
: String.Server domain.
-preferred_server
: String.IP address of the preferred DNS server.
-alternate_server
: String.IP address of the alternate DNS server.
Examples:
ibmc_network_dns 'set' do address_origin 'Static' action :set end
ibmc_network_ipv4
Manage IPv4 Network
Actions:
-
set
: Set IPv4 network.- Properties:
-
address
: String.
IPv4 address of the iBMC network port.
-origin
: String.How the IPv4 address is allocated. Value could be
Static
orDHCP
.
-gateway
: String.Gateway IPv4 address of the iBMC network port.
-mask
: String.Subnet mask of the iBMC network port.
Examples:
ibmc_network_ipv4 'set' do address '192.168.5.101' origin 'Static' gateway '192.168.5.1' mask '255.255.255.0' action :set end
ibmc_network_ipv6
Manage IPv6 Network
Actions:
-
set
: Set IPv6 network.- Properties:
-
address
: String.
IPv6 address of the iBMC network port.
-origin
: String.How the IPv6 address is allocated. Value could be
Static
orDHCPv6
.
-gateway
: String.Gateway IPv6 address of the iBMC network port.
-prefix_len
: Integer.IPv6 address prefix length of the iBMC network port.
Examples:
ibmc_network_ipv6 'set' do origin 'Static' action :set end
ibmc_network_ipversion
Manage IP version
Actions:
-
set
: Set IP version.- Properties:
-
version
: String. Required.
Enabled version of IP protocol. Value could be
IPv4AndIPv6
,IPv4
orIPv6
.
Examples:
ibmc_network_ipversion 'set' do version 'IPv4AndIPv6' action :set end
ibmc_network_vlan
Manage VLAN network
Actions:
-
set
: Set VLAN network.- Properties:
-
enabled
:true
orfalse
.
Whether VLAN is enabled.
-id
: Integer.VLAN identifier.
Examples:
ibmc_network_vlan 'set' do enabled true id 1111 action :set end
ibmc_network
Manage BMC ethernet interface
Actions:
-
get
: Get BMC ethernet interface information.- Properties:
None
Examples:
ibmc_network 'get' do action :get end
ibmc_ntp
Manage NTP service
Actions:
-
get
: Get NTP service.- Properties:
None
-
set
: Set NTP service.- Properties:
-
ntp_addr_origin
: String.
NTP mode. Value could be
Static
,IPv4
orIPv6
.
-service_enabled
:true
orfalse
.Whether NTP service is enabled.
-pre_ntp_server
: String.Preferred NTP server address.
-alt_ntp_server
: String.Alternative NTP server address.
-min_polling_interval
: Integer.Minimum NTP synchronization interval. Value ranges from 3 to 17.
-max_polling_interval
: Integer.Maximum NTP synchronization interval. Value ranges from 3 to 17.
-server_auth_enabled
:true
orfalse
.Whether authentication enabled.
Examples:
ibmc_ntp 'get' do action :get end
ibmc_os_boot
Manage OS boot setting
Actions:
-
get
: Get OS boot setting.- Properties:
None
-
set_order
: Set OS boot order.- Properties:
-
seq
: Array. Required.
System boot order. Value should be an array of all boot device. Boot device could be
Cd
,Pxe
,Hdd
orOthers
. -
set_override
: Set OS boot source override.- Properties:
-
target
: String. Required.
Boot source override target. Value could be
None
,Pxe
,Floppy
,Cd
,Hdd
orBiosSetup
.
-enabled
: String. Required.Boot source override enabled. Value could be
Once
,Disabled
orContinuous
.
-mode
: String. Required.Boot source override mode. Value could be
Legacy
orUEFI
.
Examples:
ibmc_os_boot 'get boot info' do action :get end ibmc_os_boot 'set boot order' do seq ['Cd', 'Pxe', 'Hdd', 'Others'] action :set_order end
ibmc_os_cpu
Manage OS cpu
Actions:
-
get
: Get OS cpu information.- Properties:
None
Examples:
ibmc_os_cpu 'get' do action :get end
ibmc_os_drive
Manage physical disk
Actions:
-
get
: Get the physical disk information.- Properties:
-
id
: Integer.
Physical disk id.
Examples:
ibmc_os_drive 'get' do action :get end
ibmc_os_eth
Manage OS ethernet interface
Actions:
-
get
: Get OS ethernet interface information.- Properties:
-
id
: String.
Network interface resource ID.
Examples:
ibmc_os_eth action :get end
ibmc_os_memory
Manage OS memory
Actions:
-
get
: Get OS memory information.- Properties:
None
Examples:
ibmc_os_memory 'get' do action :get end
ibmc_os_power
Manage OS power
Actions:
-
set
: Set OS power.- Properties:
-
reset_type
: String. Required.
System power reset type. Value could be
On
,ForceOff
,GracefulShutdown
,ForceRestart
,Nmi
orForcePowerCycle
.
Examples:
ibmc_os_power 'set' do reset_type 'On' action :set end
ibmc_os_product
Manage product information
Actions:
-
get
: Get product information.- Properties:
None
-
set
: Set product information.- Properties:
-
asset_tag
: String.
Asset tag.
-product_alias
: String.Product alias.
Examples:
ibmc_os_product 'get' do action :get end
ibmc_os_raid
Manage RAID information
Actions:
-
get
: Get RAID information- Properties:
-
controller_id
: Integer.
Controller ID.
-logical_drive_id
: Integer.Virtual disk ID.
Examples:
ibmc_os_raid 'get' do action :get end
ibmc_os
Manage OS
Actions:
-
install
: Install OS- Properties:
-
file
: String. Required.
SP Configuration file.
Examples:
ibmc_os 'install' do file 'config file path' action :install end
ibmc_power
Manage BMC power
Actions:
-
restart
: Restart BMC.- Properties:
None
Examples:
ibmc_power 'restart' do action :restart end
ibmc_service
Manage network service
Actions:
-
get
: Get network service information.- Properties:
-
protocol
: String.
Service protocol. Value could be
HTTP
,HTTPS
,SNMP
,VirtualMedia
,IPMI
,SSH
,KVMIP
,SSDP
orVNC
. -
set
: Set netowrk service information.- Properties:
-
protocol
: String. Required.
Service protocol. Value could be
HTTP
,HTTPS
,SNMP
,VirtualMedia
,IPMI
,SSH
,KVMIP
,SSDP
orVNC
.
-state
:true
orfalse
.Whether service enabled.
-port
: Integer.Service port.
-notify_ttl
: Integer.Time for which the SSDP messages are valid. Value range from 1 to 255
-notify_ipv6_scope
: String.IPv6 multicast range of SSDP messages. Value could be
Link
,Site
orOrganization
.
-notify_multi_cast_interval
: Integer.SSDP message multicast interval(in seconds).
Examples:
ibmc_service 'get all service' do action :get end ibmc_service 'set HTTP service' do protocol 'HTTP' state true port 80 action :set end
ibmc_smtp
Manage SMTP service
Actions:
-
get
: Get SMTP service information.- Properties:
None
-
set
: Set SMTP service information.- Properties:
-
service_enabled
:true
orfalse
.
Whether SMTP service enabled.
-server_addr
: String.SMTP server address.
-tls_enabled
:true
orfalse
.Whether SMTP TLS enabled.
-anonymous_login_enabled
:true
orfalse
.Whether anonymous login enabled.
-sender_addr
: String.Email sender address.
-sender_password
: String.Email sender password.
-sender_username
: String.Email sender username.
-email_subject
: String.Email subject.
-email_subject_contains
: Array.Email subject keywords. Should be an array of keyword. Keyword could be
HostName
,BoardSN
orProductAssetTag
.
-alarm_severity
: String.Severity level of alarm to be sent. Value could be
Critical
,Major
,Minor
orNormal
.
Examples:
ibmc_smtp 'get' do action :get end
ibmc_snmp
Manage SNMP service
Actions:
-
get
: Get SNMP service information.- Properties:
None
-
set
: Set SNMP service information.- Properties:
-
v1_enabled
:true
orfalse
.
Whether SNMPv1 enabled.
-v2_enabled
:true
orfalse
.Whether SNMPv2 enabled.
-long_pass_enabled
:true
orfalse
.Whether long password enabled.
-rw_community_enabled
:true
orfalse
.Whether read-write community name enabled.
-readonly_community
: String.Read-only community name.
-readwrite_community
: String.Read-write community name.
-v3_auth_protocol
: String.SNMPv3 authentication algorithm. Value could be
MD5
orSHA1
-v3_priv_protocol
: String.SNMPv3 encryption algorithm. Value could be
DES
orAES
.
-service_enabled
:true
orfalse
.Whether trap is enabled.
-trap_version
: String.Trap version. Value could be
V1
,V2C
orV3
.
-trap_v3_user
: String.SNMPv3 user name.
-trap_mode
: String.Trap mode. Value could be
OID
,EventCode
orPreciseAlarm
.
-trap_server_identity
: String.Host identifier. Value could be
BoardSN
,ProductAssetTag
orHostName
.
-community_name
: String.Community name.
-alarm_severity
, String.Severity level of the alarm to be sent. Value could be
Critical
,Major
,Minor
orNormal
.
-trap_server1_enabled
:true
orfalse
.Whether trap server 1 enabled.
-trap_server2_enabled
:true
orfalse
.Whether trap server 2 enabled.
-trap_server3_enabled
:true
orfalse
.Whether trap server 3 enabled.
-trap_server4_enabled
:true
orfalse
.Whether trap server 4 enabled.
-trap_server1_address
: String.Trap server 1 address.
-trap_server2_address
: String.Trap server 2 address.
-trap_server3_address
: String.Trap server 3 address.
-trap_server4_address
: String.Trap server 4 address.
-trap_server1_port
: Integer.Trap server 1 port.
-trap_server2_port
: Integer.Trap server 2 port.
-trap_server3_port
: Integer.Trap server 3 port.
-trap_server4_port
: Integer.Trap server 4 port.
Examples:
ibmc_snmp 'get' do action :get end
ibmc_sp
Manage SP service
Actions:
-
get
: Get SP service information.- Properties:
None
-
enable
: Enable SP start and restart system.- Properties:
None
-
upgrade
: Upgrade SP service.- Properties:
-
image_uri
: String. Required.
Path of the upgrade package on a remote server. (e.g., protocol://username:password@ip/directory/filename.)
-signature_uri
: String. Required.Path of the upgrade package digital signature on a remote server. (e.g., protocol://username:password@ip/directory/filename.)
-parameter
: String. Required.all
indicates the entire upgrade package or a specific upgrade package.
-mode
: String. Required.Mode of the upgrade. Value could be
Auto
,Full
,Recover
,APP
orDriver
.
-active_method
: String. Required.How does the upgrade take effect.
Examples:
ibmc_sp 'get' do action :get end ibmc_sp `enable` do action :enable end
ibmc_user
Manage BMC user
Actions:
-
get
: Get BMC user.- Properties:
None
-
add
: Add BMC user.- Properties:
-
username
: String. Required.
BMC user name.
-password
: String. Required.BMC user password.
-role
: String. Required.BMC user role. Value could be
Administrator
,Operator
,Commonuser
,Noaccess
,CustomRole1
,CustomRole2
,CustomRole3
orCustomRole4
. -
delete
: Delete BMC user.- Properties:
-
username
: String. Required.
BMC user name.
-
set
: Set BMC user.- Properties:
-
username
: String. Required.
BMC user name.
-new_username
: String.BMC new user name.
-new_password
: String.BMC new user password.
-new_role
: String.BMC new user role. Value could be
Administrator
,Operator
,Commonuser
,Noaccess
,CustomRole1
,CustomRole2
,CustomRole3
orCustomRole4
.
-locked
:true
orfalse
. Defaultfalse
.Whether the user is locked.
-enabled
:true
orfalse
Whether the user enabled.
Examples:
ibmc_user 'add user' do username 'test' password 'pass' role 'Commonuser' action :add end ibmc_user 'update user' do username 'test' new_username 'new_name' action :set end ibmc_user 'delete user' do username 'new_name' action :delete end
ibmc_vm
Manage virtual media
Actions:
-
connect
: Connect virtual media.- Properties:
-
image
: String. Required.
VRI of the virtual media image.
-
disconnect
: Disconnect virtual media.- Properties:
-
image
: String.
VRI of the virtual media image.
Examples:
ibmc_vmm 'connect' do image 'VRI' action :connect end
Dependent cookbooks
This cookbook has no specified dependencies.
Contingent cookbooks
There are no cookbooks that are contingent upon this one.
chef-ibmc-cookbook CHANGELOG
This file is used to list changes made in each version of the chef-ibmc-cookbook cookbook.
Collaborator Number Metric
0.2.0 failed this metric
Failure: Cookbook has 0 collaborators. A cookbook must have at least 2 collaborators to pass this metric.
Contributing File Metric
0.2.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file
Foodcritic Metric
0.2.0 passed this metric
No Binaries Metric
0.2.0 failed this metric
Failure: Cookbook should not contain binaries. Found:
chef-ibmc-cookbook/files/default/uREST.tar.gz
Testing File Metric
0.2.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
0.2.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
0.2.0 failed this metric
0.2.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file
Foodcritic Metric
0.2.0 passed this metric
No Binaries Metric
0.2.0 failed this metric
Failure: Cookbook should not contain binaries. Found:
chef-ibmc-cookbook/files/default/uREST.tar.gz
Testing File Metric
0.2.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
0.2.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
0.2.0 passed this metric
0.2.0 failed this metric
Failure: Cookbook should not contain binaries. Found:
chef-ibmc-cookbook/files/default/uREST.tar.gz
Testing File Metric
0.2.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
0.2.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
0.2.0 failed this metric
0.2.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number