Permalink
Browse files

COOK 2121: yum_repo add create action

  • Loading branch information...
1 parent b119151 commit 14011770843adea6e9974ea03f441f6e45b65916 @jcam jcam committed Dec 25, 2012
Showing with 8 additions and 2 deletions.
  1. +2 −1 README.md
  2. +5 −0 providers/repository.rb
  3. +1 −1 resources/repository.rb
View
@@ -145,7 +145,8 @@ repo is added.
#### Actions
-- :add: creates a repository file and builds the repository listing (default)
+- :create: creates a repository file and builds the repository listing
+- :add: runs create action if repository file is missing (default)
- :remove: removes the repository file
- :update: updates the repository
View
@@ -32,6 +32,11 @@ def whyrun_supported?
end
end
+action :create do
+ Chef::Log.info "Adding and updating #{new_resource.repo_name} repository in /etc/yum.repos.d/#{new_resource.repo_name}.repo"
+ repo_config
+end
+
action :remove do
if ::File.exists?("/etc/yum.repos.d/#{new_resource.repo_name}.repo")
Chef::Log.info "Removing #{new_resource.repo_name} repository from /etc/yum.repos.d/"
View
@@ -17,7 +17,7 @@
# limitations under the License.
#
-actions :add, :remove, :update
+actions :add, :remove, :update, :create
#name of the repo, used for .repo filename
attribute :repo_name, :kind_of => String, :name_attribute => true

0 comments on commit 1401177

Please sign in to comment.