Ensures specified packages are installed and patched.
- Tested on CentOS 6.5
- Tested on Ubuntu 12.04 LTS
- Should work on a wide variety of other *nix systems
Hash of packages and their associated minimum version.
Example:
node.default['patch-management']['packages'] = {'httpd' => '2.2.15-39.el6', 'bash' => '4.1.2-29.el6'}
- Audits and remediates over specified packages/versions.
-
Installs an OHAI plugin (based on the rackerlabs 'packages' plugin: https://github.com/rackerlabs/ohai-plugins/tree/master/plugins) that will catalog installed packages for evaluation. Provides a node['software'] automatic attribute that lists installed packages and their versions.
-
Iterates through the hash specified in node['patch-management']['packages'] and sets a node['patch-management']['patched'] boolean to true if all packages are installed and of the correct version or later, or false if any are not present, or of a version different than the one specified in the attribute hash.
- Iterates through the hash specified in node['patch-management']['packages'] and ensures that the packages contained theirein are installed and at least the version specified in the hash. Installs packages that aren't present, upgrades those that are below the specified version. Will set node['patch-management']['patched'] to true if it completes without issue.
Include patch-management
in your node's run_list
, and be sure to set the "packages" hash for your node/role/etc.
Example:
{
"patch-management": {
"packages": {
"httpd": "2.2.15-39.el6",
"bash": "4.1.2-29.el6"
}
}
}
Author:: Chef Software, Inc ([email protected])
Author:: Nicolas Rycar ([email protected])
Author:: Andre Elizondo ([email protected])
Copyright:: 2014, 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.
- 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