- Description
- Requirements
- Platforms - which platforms are supported
- Attributes
- Usage
- How to contribute
ilorest is a Chef cookbook that installs the Python ilorest library and runs a handful of examples included in the library. Currently ilorest works with Windows Server and any 'nix distribution.
ilorest was written primarily as an example for server administrators to use as a template or basis for writing their own modules using the ilorest library. ilorest installs the ilorest library as part of the installation to preserve idempotency along with managing the example scripts.
ilorest starts by installing the python ilorest library through the usage of pip install. It has been set to be idempotent and supports multiple runs. Additionally, it also copies the required files into the node's cache. Subsequently, it runs a few examples with either default or set attributes. These examples are ex09, ex03, and ex14. Find MAC address, Change a bios setting, and managing a user session.
Note: These examples have been slightly modified from the originals. They support arguments passing the iLO credentials.
ilorest requires the node to have Python version 2.7.11+ installed for ilorest to work properly. It is suggested that poise-python
be used for python installation and management.
It is strongly suggested by Chef and us that chef-client be run as root or administrator, to ensure that everything is working properly. If root/administrator is not used, ilorest may fail.
- Windows Server 2012, Ubuntu, Red Hat Linux
- Chef 12.0 or later
poise-python
- ilorest needs python to be pre-installed.
These are default values that ilorest is set to.
Key | Type | Description | Default |
---|---|---|---|
['ilorest']['iLO_IP'] | String | IP address of the node's iLO | 10.0.0.100 |
['ilorest']['iLO_username'] | String | username to login to the node's iLO | admin |
['ilorest']['iLO_password'] | String | password to login to the node's iLO | password |
include ilorest
in your node's run_list
to use the default values.
It is suggested that the attributes be edited before using since the default iLO IP address is unlikely to be the same as your node's. See the attribute example below for help in setting the attributes in JSON format.
Attribute example
Below is an example of what the attributes should look like when edit attributes is selected through the Chef Manage UI.
{
"ilorest": {
"iLO_IP" : "16.1.1.10",
"iLO_username": "admin",
"iLO_password": "password",
}
}
Examples can be easily added or replaced by following the format for the execute resource. newexample.py should be replaced with the new script you want to execute. live_stream is set to true here to show an output. The #{platformdirectory}
variable is set depending on the platform running this module, and the ['ilorest']
attributes are set in the default.rb in the attribute's folder, or set through the use of knife
or through the Chef Management UI.
execute "new example" do
command "newexample.py #{node['ilorest']['iLO_IP']} #{node['ilorest']['iLO_username']} #{node['ilorest']['iLO_password']}"
cwd "#{platformdirectory}"
live_stream true
end
Note: live_stream is set to true to produce log results.
- Fork the repository on Github
- Create a named feature branch (like
add_component_x
) - Write your change
- Write tests for your change (if applicable)
- Run the tests, ensuring they all pass
- Submit a Pull Request using Github
- 01/10/2017: Initial Commit
Copyright 2017 Hewlett Packard Enterprise Development LP
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.