This is a Chef cookbook to manage to manage Yum plugin to lock specified packages from being updated.
For Production environment, always prefer the most recent release.
cookbook 'yum-plugin-versionlock', '~> 0.1.2'
cookbook 'yum-plugin-versionlock', github: 'nkts/chef-yum-plugin-versionlock', tag: "v0.1.2"
https://github.com/nkts/chef-yum-plugin-versionlock
This cookbook was tested on CentOS 6.8 and expected to work on other RHEL platforms.
- yum
yum-plugin-versionlock::default
- installs and configure yum plugin versionlock
LWRP yum_version_lock
add/remove/update yum version lock list file default['yum-plugin-versionlock']['locklist']
for a package (EPOCH:NAME-VERSION-RELEASE.ARCH
).
LWRP Yum Lock Package Version example
yum_version_lock 'topbeat' do
version '1.2.3'
release '1'
action :add
end
LWRP Yum Update existing Package Version Lock example
yum_version_lock 'topbeat' do
version '1.2.3'
release '1'
action :update
end
Note: action
:update
check for existing package release and update to newer version if exists, otherwise creates package version lock.
LWRP Yum Remove Package Version Lock example
yum_version_lock 'topbeat' do
version '1.2.3'
release '1'
action :remove
end
LWRP Options
- action (optional) - default
:add
, options: :add, :remove, :update, :nothing - epoch (optional, String/Integer) - yum package version lock epoch value
- package (optional, String) - default
resource_name
, yum package name - version (optional, String) - yum package version
- release (optional, String) - yum package release
- arch (optional, String) - default
node['kernel']['machine']
, yum package arch
-
default['yum-plugin-versionlock']['enabled']
(default:1
): yum plugin versionlock config attribute -
default['yum-plugin-versionlock']['follow_obsoletes']
(default:0
): yum plugin versionlock config attribute -
default['yum-plugin-versionlock']['locklist']
(default:/etc/yum/pluginconf.d/versionlock.list
): yum plugin versionlock lock list file
- 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
Author: Marius Karnauskas ([email protected]) and Contributors