Created
July 18, 2014 19:43
-
-
Save Phelms215/654280dfb51f2a391e62 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
updateList = node["UPDATES"] | |
updateList.each do |(key,x)| | |
puts x['Name'] | |
updateTime = Time.at( x["Time"].to_i / 1000 ) | |
t1 = Time.now | |
now = Time.at(t1.to_i) | |
puts updateTime | |
if now > updateTime | |
if platform?("redhat", "centos", "fedora") | |
yum_package "#{x['Name']}" do | |
version "#{x['Version']}" | |
allow_downgrade true | |
action :upgrade | |
end | |
end #end platform redhat | |
# | |
# Run if platform is debian or ubuntu | |
# | |
if platform?("ubuntu", "debian") | |
apt_package "#{x['Name']}" do | |
version "#{x['Version']}" | |
allow_downgrade true | |
action :upgrade | |
end | |
end #end of if platform deb | |
node.delete("UPDATES[#{key}]") | |
node.save | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment