Created
October 26, 2010 16:28
-
-
Save ymek/647229 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
# | |
# Cookbook Name:: chef | |
# Recipe:: default | |
# | |
# Copyright 2010, Escape Media Group, Inc. | |
# | |
# All rights reserved - Do Not Redistribute | |
# | |
# install/enable the epel/elff repos if required | |
execute "rpm -Uh --quiet #{node[:chef][:epel_repo]}" do | |
not_if { File.exists?('/etc/yum.repos.d/epel.repo') } | |
end | |
execute "rpm -Uh --quiet #{node[:chef][:elff_repo]}" do | |
not_if { File.exists?('/etc/yum.repos.d/elff.repo') } | |
end | |
execute "sed -i '0,/enabled=[01]/s//enabled=1/' /etc/yum.repos.d/epel.repo" do | |
only_if { File.exists?('/etc/yum.repos.d/epel.repo') } | |
end | |
execute "sed -i '0,/enabled=[01]/s//enabled=1/' /etc/yum.repos.d/elff.repo" do | |
only_if { File.exists?('/etc/yum.repos.d/elff.repo') } | |
end | |
# upgrade chef | |
package "chef" do | |
action :upgrade | |
end | |
# disable the epel/elff repos | |
execute "sed -i '0,/enabled=[01]/s//enabled=0/' /etc/yum.repos.d/epel.repo" do | |
# Should exist as we installed it above | |
#only_if { File.exists?('/etc/yum.repos.d/epel.repo') } | |
end | |
execute "sed -i '0,/enabled=[01]/s//enabled=0/' /etc/yum.repos.d/elff.repo" do | |
# Should exist as we installed it above | |
#only_if { File.exists?('/etc/yum.repos.d/elff.repo') } | |
end | |
~ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment