GithubHelp home page GithubHelp logo

isabella232 / hp-sum-cookbook Goto Github PK

View Code? Open in Web Editor NEW

This project forked from chef-boneyard/hp-sum-cookbook

0.0 0.0 0.0 381 KB

Cookbook for managing firmware and drivers with HP Smart Update Manager

Ruby 92.33% HTML 7.67%

hp-sum-cookbook's Introduction

Description

Cookbook to manage updates with HP Smart Update Manager.

Attributes

  • ['hpsum']['path'] path to cache HP SUM files, nil unless customer provides permanent location
  • ['hpsum']['policy']['allow_reboot'] true by default
  • ['hpsum']['inventory']['lastcheck'] timestamp
  • ['hpsum']['inventory']['interval'] how frequently the policty
  • ['hpsum']['baseline']['mount'][] list of HP SUM baseline mounts

Recipes

baseline_role_generator

Dynamically generate new roles from the baselines by iterating over the node['hpsum']['baseline']['mount'].keys using cheffish chef_role. Parses XML to dynamically generate roles.

Roles

Baselines are managed as roles that provide the packages and their required versions.

role[bl_production]
[hpsum][bl][prod][action] = "downgrade"
[hpsum][bl][prod][ilo_firmware] = "2.3.1.2"
[hpsum][bl][prod][nic] = "9.2.3.5"
[hpsum][bl][prod][raidcontroller] = "1.2.3.5"
[hpsum][bl][prod][usbcontroller] = "9.2.3.5"
role[bl_hotfix]
[hpsum][bl][hotfix][action] = "rewrite"
[hpsum][bl][hotfix][raidcontroller] = "1.2.3.7"
role[bl_hotfix2]
[hpsum][bl][hotfix2][action] = "upgrade"
[hpsum][bl][hotfix2][raidcontroller2] = "1.2.3.9"

node[hpsum][bl].keys.each do |baseline| baseline.keys.each do |pkg| hpsum_package pkg do action pkg[action] version pkg[version] allow_retry true allow_reboot true end end

inventory_check

This recipe checks if a node has run an inventory check within the specified interval time. If the interval has been exceeded it will run a new inventory check, iterating over the baseline mount points and generating new XML for future compliance checks. These timestamps are stored as the following node attributes:

  • ['hpsum']['inventory']['lastcheck'] timestamp of last inventory check
  • ['hpsum']['inventory']['interval'] time (in seconds) for the interval policy

The following knife command provides an example of generating a report to identify machines out of policy.

    chef exec knife exec example_scripts/inventory_check.rb

parse_node_data

Iterates over mount points, pushes XML into node object. Could be used for a compliance report. No changes to the node.

You can do an ad-hoc report knife exec check packages report role says [hpsum][bl][hotfix][raidcontroller] = "1.2.3.7" node says [hpsum][bl][hotfix][raidcontroller] = "1.2.3.9"

generate_audit_event

What sort of reports do we want to generate and where do they go? Audit cookbook or process data for Analytics.

package_update

Performs updates Call the HPSUM CLI to generate the new XML files based off of each baseline. Mounts each HP SUM mount and runs the CLI, generating XML files hpsum -s --rewrite|downgrade --use_location Set environment for permanent HP SUM as an option %TMP% rewrite requires preventing multiple runs

License and Authors

Author:: Matt Ray ([email protected])

Copyright 2015 Chef Software, Inc.

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.

hp-sum-cookbook's People

Contributors

eloy17 avatar mattray avatar ndachel avatar sootythebear avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.