Version information
Start using this module
Add this module to your Puppetfile:
mod 'serverplugin-rest', '1.2.0'
Learn more about managing modules with a PuppetfileDocumentation
rest
Table of Contents
- Description
- Setup - The basics of getting started with rest
- Usage - Configuration options and additional functionality
- Limitations - OS compatibility, etc.
- Development - Guide for contributing to the module
Description
The Rest module is used to manage Huawei Servers with iBMC. This module provides some Puppet resource types and samples manifests for various features of the Huawei iBMC.
Setup
What rest affects
The Rest module implements all puppet resource types with Exec
module which execute python scripts(Rest-Linux)
and those python scripts will access iBMC using Redfish API.
The Rest module will do:
- Install
Rest-Linux
(scripts folder) to/etc/puppet/modules/rest/files
- Install
stdlib>=5.0.0
module
Setup Requirements
- Puppet Master/Agent version >= 5.0.0
- Puppet Agent OS family should be
redhat
- Python 2.7 should be in ENV path in Puppet Agent
Beginning with rest
puppet module install serverplugin-rest
Check Puppet Labs: Installing Modules for more information.
Usage
These Puppet resources are defined as part of Rest
module:
rest::bios::boot::get
rest::bios::boot::order
rest::bios::boot::override
rest::bios::get
rest::bios::restore
rest::bios::set
rest::bmc::ethernet::dns
rest::bmc::ethernet::get
rest::bmc::ethernet::ipv4
rest::bmc::ethernet::ipv6
rest::bmc::ethernet::ipversion
rest::bmc::ethernet::vlan
rest::bmc::license::delete
rest::bmc::license::export
rest::bmc::license::get
rest::bmc::license::install
rest::bmc::ntp::get
rest::bmc::ntp::set
rest::bmc::power::ctrl
rest::bmc::power::restart
rest::bmc::service::get
rest::bmc::service::set
rest::bmc::smtp::get
rest::bmc::smtp::set
rest::bmc::snmp::get
rest::bmc::snmp::set
rest::bmc::vmm::connect
rest::bmc::vmm::disconnect
rest::chassis::led::set
rest::firmware::inband::upgrade
rest::firmware::inband::version
rest::firmware::outband::upgrade
rest::firmware::outband::version
rest::firmware::sp::result
rest::firmware::sp::set
rest::firmware::sp::upgrade
rest::firmware::sp::version
rest::system::assettag::set
rest::system::cpu::health
rest::system::cpu
rest::system::deploy::config
rest::system::drive::health
rest::system::drive
rest::system::eth::get
rest::system::fan::health
rest::system::get
rest::system::memory::health
rest::system::memory
rest::system::network_adapter::health
rest::system::network_adapter
rest::system::power_supply::health
rest::system::raid::health
rest::system::raid
rest::user::add
rest::user::delete
rest::user::get
rest::user::set
Common Attributes
All Rest resource type share those attributes:
Attribute | Description |
---|---|
ibmc_username | iBMC login username |
$ibmc_password | iBMC login password |
$ibmc_host | iBMC API access host, default 127.0.0.1 |
$ibmc_port | iBMC API access port, default 443 |
Rest module resource types can visit iBMC API anywhere, resource type is free to run on anywhere.
rest::bios::boot::get
Get boot settings.
Attributes
No additional attributes
Examples Manifest
rest::bios::boot::order
Set boot order.
Additional Attributes
Attribute | Type | Description |
---|---|---|
sequence | Array[String] | boot order sequence |
Examples Manifest
rest::bios::boot::override
Set boot source override.
Additional Attributes
Attribute | Type | Description |
---|---|---|
target | Enum | boot source |
enabled | Boolean | boot source override times |
Examples Manifest
rest::bios::get
Get BIOS attribute.
Additional Attributes
Attribute | Type | Description |
---|---|---|
attribute | String | indicates the BIOS attribute |
Examples Manifest
rest::bios::restore
Restore BIOS attribute.
Additional Attributes
No additional attributes
Examples Manifest
rest::bios::set
Set BIOS attribute.
Additional Attributes
Attribute | Type | Description |
---|---|---|
attribute | String | attribute name |
value | String | attribute value |
Examples Manifest
rest::bmc::ethernet::dns
Set iBMC ethernet DNS.
Additional Attributes
Attribute | Type | Description |
---|---|---|
hostname | String | iBMC hostname |
domain | String | iBMC domain name |
address_origin | Enum | How to allocate DNS address |
preferred_server | String | preferred DNS server address |
alternate_server | String | alternative DNS server address |
Examples Manifest
rest::bmc::ethernet::get
Get iBMC ethernet interface information.
Additional Attributes
No additional attributes
Examples Manifest
rest::bmc::ethernet::ipv4
Set iBMC ethernet IPv4 address.
Additional Attributes
Attribute | Type | Description |
---|---|---|
ip | String | IPv4 address |
gateway | String | gateway IP address |
mask | String | subnet mask |
address_origin | Enum | How to allocate IP. It can be Static or DHCP |
Examples Manifest
rest::bmc::ethernet::ipv6
Set iBMC ethernet IPv6 address.
Additional Attributes
Attribute | Type | Description |
---|---|---|
ip | String | IPv6 address |
gateway | String | gateway IP address |
prefix_length | integer | IPv6 address prefix length |
address_origin | Enum | How to allocate IP. It can be Static, DHCPv6, LinkLocal, SLAAC. |
Examples Manifest
rest::bmc::ethernet::ipversion
Set iBMC ethernet IP version.
Additional Attributes
Attribute | Type | Description |
---|---|---|
value | String | IP version. It can be IPv4AndIPv6, IPv4, IPv6. |
Examples Manifest
rest::bmc::ethernet::vlan
Set iBMC ethernet VLAN.
Additional Attributes
Attribute | Type | Description |
---|---|---|
enabled | Boolean | whether VLAN is enabled. |
vlan_id | Integer | VLAN id (1-4094). |
Examples Manifest
rest::bmc::license::delete
Delete iBMC license.
Additional Attributes
No additional attributes
Examples Manifest
rest::bmc::license::export
Export iBMC license.
Additional Attributes
Attribute | Type | Description |
---|---|---|
export_to | String | the file path of export license file. |
Examples Manifest
rest::bmc::license::get
Get iBMC license infomation.
Additional Attributes
No additional attributes
Examples Manifest
rest::bmc::license::install
Install iBMC license.
Additional Attributes
Attribute | Type | Description |
---|---|---|
source | Enum | License source. |
type | Enum | Methods of installing the license file. It can be Text, URI. |
content | String | License content. |
Examples Manifest
rest::bmc::ntp::get
Get NTP settings.
Additional Attributes
No additional attributes
Examples Manifest
rest::bmc::ntp::set
Setup NTP.
Additional Attributes
Attribute | Type | Description |
---|---|---|
enabled | Boolean | whether NTP service enabled or not |
addr_origin | Enum | Ntp Address Origin |
preferred_server | String | preferred NTP server address |
alternate_server | String | alternative NTP server address |
auth_enabled | Boolean | whether auth enabled |
min_interval | Integer | minimum NTP synchronization interval. the value ranges from 3 to 17 |
max_interval | Integer | maximum NTP synchronization interval. the value ranges from 3 to 17 |
Examples Manifest
rest::bmc::power::ctrl
Power Ctrl
Additional Attributes
Attribute | Type | Description |
---|---|---|
reset_type | Enum | Power Reset Type |
Examples Manifest
rest::bmc::power::restart
iBMC Power Restart.
Additional Attributes
No additional attributes
Examples Manifest
rest::bmc::service::get
Get service information
Additional Attributes
no additional attributes
Examples Manifest
rest::bmc::service::set
Update service settings
Additional Attributes
Attribute | Type | Description |
---|---|---|
protocol | Enum | indicates the Service to update |
enabled | Boolean | indicates if the protocol property State is enabled or disabled |
port | Integer | indicates the protocol property port range is 1 to 65535 |
notify_ttl | Integer | indicates the protocol SSDP property, NotifyTTL range is 1 to 255 |
notify_scope | Enum | indicates the protocol SSDP property NotifyIPv6Scope |
notify_interval | Integer | indicates the notify multicast interval seconds |
Examples Manifest
rest::bmc::smtp::get
Get SMTP settings
Additional Attributes
no additional attributes
Examples Manifest
rest::bmc::smtp::set
Update SMTP settings
Additional Attributes
Attribute | Type | Description |
---|---|---|
enabled | Boolean | indicates the SMTP state is enabled or disabled |
server_addr | String | indicates if SMTP server address |
tls_enabled | Enum | indicates if SMTP server support TLS or not |
anon_enabled | Enum | indicates if SMTP server support anon |
sender_addr | String | indicates the SMTP sender address |
sender_password | String | indicates the SMTP sender password |
sender_username | String | indicates the SMTP sender username |
email_subject | String | indicates the SMTP sent email subject |
email_subject_contains | Array[Enum] | indicates the SMTP sent email subject additional contents |
alarm_severity | Enum | indicates the alarm severity to send email |
receipt1 | Struct[TrapServer] | indicates the SMTP receipt 1 |
receipt2 | Struct[TrapServer] | indicates the SMTP receipt 2 |
receipt3 | Struct[TrapServer] | indicates the SMTP receipt 3 |
receipt4 | Struct[TrapServer] | indicates the SMTP receipt 4 |
Examples Manifest
rest::bmc::snmp::get
Get SNMP settings
Additional Attributes
no additional attributes
Examples Manifest
rest::bmc::snmp::set
Update SNMP settings
Additional Attributes
Attribute | Type | Description |
---|---|---|
v1_enabled | Boolean | indicates Whether SNMPv1 is enabled |
v2_enabled | Boolean | indicates Whether SNMPv2 is enabled |
long_password_enabled | Boolean | indicates Whether long passwords are enabled |
rw_community_enabled | Boolean | indicates Whether read-write community name are enabled |
rw_community | String | indicates the Read-Write community name |
ro_community | String | indicates the Read-only community name |
v3_auth_protocol | Enum | indicates the SNMPv3 authentication algorithm |
v3_priv_protocol | Enum | indicates the SNMPv3 encryption algorithm |
trap_enabled | Boolean | indicates Whether trap is enabled |
trap_v3_user | String | indicates the SNMPv3 user name |
trap_version | Enum | indicates the trap version |
trap_mode | Enum | indicates the trap mode |
trap_server_identity | Enum | indicates the trap Host identifier |
trap_community | String | indicates the Community name |
trap_alarm_severity | Enum | indicates the Severity level of the alarm to be sent |
trap_server1 | Struct[TrapServer] | indicates the trap server 1 |
trap_server2 | Struct[TrapServer] | indicates the trap server 2 |
trap_server3 | Struct[TrapServer] | indicates the trap server 3 |
trap_server4 | Struct[TrapServer] | indicates the trap server 4 |
Examples Manifest
rest::bmc::vmm::connect
Connect to virtual media.
Additional Attributes
Attribute | Type | Description |
---|---|---|
image_uri | String | VRI of the virtualmedia image |
Examples Manifest
rest::bmc::vmm::disconnect
Disconnect virtual media.
Additional Attributes
no additional attributes
Examples Manifest
rest::chassis::led::set
Set chassis indicator LED status.
Additional Attributes
Attribute | Type | Description |
---|---|---|
state | Enum | indicates the state of chassis LED, it can be Lit, Off, Blinking. |
Examples Manifest
rest::firmware::inband::upgrade
Upgrade inband firmware.
Additional Attributes
Attribute | Type | Description |
---|---|---|
firmware_file_uri | String | indicates the firmware file url. |
signal_file_uri | String | indicates the signal file url of the firmware file. |
mode | Enum | indicates the upgrade mode, it can be Auto, Full, Recover, APP, Driver. |
active_method | Enum | indicates the firmware active method, it can be Restart. |
Examples Manifest
rest::firmware::inband::version
Get inband firmware version.
Additional Attributes
no additional attributes
Examples Manifest
firmware_inband_version_get.pp
rest::firmware::outband::upgrade
Upgrade outband firmware.
Additional Attributes
Attribute | Type | Description |
---|---|---|
firmware_file_uri | String | indicates the firmware file url. |
Examples Manifest
rest::firmware::outband::version
Get outband firmware version.
Additional Attributes
no additional attributes
Examples Manifest
firmware_outband_version_get.pp
rest::firmware::sp::result
Get Smart Provisioning result.
Additional Attributes
no additional attributes
Examples Manifest
rest::firmware::sp::set
Upgrade Smart Provisioning service.
Additional Attributes
Attribute | Type | Description |
---|---|---|
start_enabled | boolean | indicates whether SP start is enabled. |
system_restart_delay_seconds | integer | indicates maximum seconds allowed for the restart of the OS. |
timeout | integer | indicates maximum time (300~86400) allowed for SP deployment. |
finished | boolean | indicates Status of the transaction deployed. |
Examples Manifest
rest::firmware::sp::upgrade
Upgrade Smart Provisioning service.
Additional Attributes
Attribute | Type | Description |
---|---|---|
firmware_file_uri | String | indicates the firmware file url. |
mode | Enum | indicates the upgrade mode, it can be Auto, Full, Recover, APP, Driver. |
active_method | Enum | indicates the firmware active method, it can be Restart. |
Examples Manifest
rest::firmware::sp::version
Get Smart Provisioning service version.
Additional Attributes
no additional attributes
Examples Manifest
rest::system::assettag::set
Update iBMC asset tag.
Additional Attributes
Attribute | Type | Description |
---|---|---|
value | String | indicates the asset tag. |
Examples Manifest
rest::system::cpu
Get CPU List
Additional Attributes
no additional attributes
Examples Manifest
rest::system::cpu::health
Get CPU health infomation
Additional Attributes
no additional attributes
Examples Manifest
rest::system::deploy::config
Update system OS deploy configuration.
Additional Attributes
Attribute | Type | Description |
---|---|---|
os_deploy_config_file_path | String | indicates the file path of OS deploy configuration JSON file path. |
Examples Manifest
rest::system::drive
Get physical drive list
Additional Attributes
no additional attributes
Examples Manifest
rest::system::drive::health
Get physical drive health infomation.
Additional Attributes
no additional attributes
Examples Manifest
rest::system::eth::get
Get system ethernet list.
Additional Attributes
no additional attributes
Examples Manifest
rest::system::fan::health
Get fan health infomation.
Additional Attributes
no additional attributes
Examples Manifest
rest::system::get
Get system infomation.
Additional Attributes
no additional attributes
Examples Manifest
rest::system::memory
Get memory list
Additional Attributes
no additional attributes
Examples Manifest
rest::system::memory::health
Get memory health infomation.
Additional Attributes
no additional attributes
Examples Manifest
rest::system::network_adapter::health
Get system network adaptor health infomation.
Additional Attributes
no additional attributes
Examples Manifest
rest::system::network_adapter
Get system network adaptor infomation.
Additional Attributes
no additional attributes
Examples Manifest
rest::system::power_supply::health
Get power supply health infomation.
Additional Attributes
no additional attributes
Examples Manifest
rest::system::raid
Get RAID controller list
Additional Attributes
no additional attributes
Examples Manifest
rest::system::raid::health
Get RAID health infomation.
Additional Attributes
no additional attributes
Examples Manifest
rest::user::add
Add new user
Additional Attributes
Attribute | Type | Description |
---|---|---|
username | String | indicates the new created user's username |
password | String | indicates the new created user's password |
role | Enum | indicates the new created user's role |
Examples Manifest
rest::user::delete
Add new user
Additional Attributes
Attribute | Type | Description |
---|---|---|
username | String | indicates the user to be deleted |
Examples Manifest
rest::user::get
Get user list
Additional Attributes
no additional attributes
Examples Manifest
rest::user::set
Update user attributes
Additional Attributes
Attribute | Type | Description |
---|---|---|
username | String | indicates the user to be updated |
newusername | String | indicates new name for user |
newpassword | String | indicates new password for the user |
newrole | Enum | indicates new role for user |
enabled | Boolean | indicates if the user is enabled |
locked | Boolean | indicates if the user is locked |
Examples Manifest
Limitations
This is where you list OS compatibility, version compatibility, etc. If there are Known Issues, you might want to include them under their own heading here.
Development
Feel free to fork repo and send PR.
Dependencies
- puppetlabs-stdlib (>= 5.0.0)
# Released under MIT License Copyright (c) 2013 Mark Otto. Copyright (c) 2017 Andrew Fong. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.