Update cookbooks and add wordpress cookbook

This commit is contained in:
Greg Karékinian
2016-02-19 18:09:49 +01:00
parent 9ba973e3ac
commit 820b0ab3f8
606 changed files with 22421 additions and 14084 deletions

View File

@@ -25,12 +25,12 @@ def whyrun_supported?
true
end
action :create do
action :create do
template new_resource.path do
source 'main.erb'
cookbook 'yum'
mode '0644'
variables(:config => new_resource)
variables(config: new_resource)
end
end

View File

@@ -30,12 +30,19 @@ def whyrun_supported?
true
end
action :create do
action :create do
# Hack around the lack of "use_inline_resources" before Chef 11 by
# uniquely naming the execute[yum-makecache] resources. Set the
# notifies timing to :immediately for the same reasons. Remove both
# of these when dropping Chef 10 support.
if new_resource.clean_headers
Chef::Log.warn <<-eos
Use of `clean_headers` in resource yum[#{new_resource.repositoryid}] is now deprecated and will be removed in a future release.
`clean_metadata` should be used instead
eos
end
template "/etc/yum.repos.d/#{new_resource.repositoryid}.repo" do
if new_resource.source.nil?
source 'repo.erb'
@@ -44,22 +51,23 @@ action :create do
source new_resource.source
end
mode new_resource.mode
variables(:config => new_resource)
sensitive new_resource.sensitive
variables(config: new_resource)
if new_resource.make_cache
notifies :run, "execute[yum clean #{new_resource.repositoryid}]", :immediately
notifies :run, "execute[yum clean metadata #{new_resource.repositoryid}]", :immediately if new_resource.clean_metadata || new_resource.clean_headers
notifies :run, "execute[yum-makecache-#{new_resource.repositoryid}]", :immediately
notifies :create, "ruby_block[yum-cache-reload-#{new_resource.repositoryid}]", :immediately
end
end
execute "yum clean #{new_resource.repositoryid}" do
command "yum clean all --disablerepo=* --enablerepo=#{new_resource.repositoryid}"
execute "yum clean metadata #{new_resource.repositoryid}" do
command "yum clean metadata --disablerepo=* --enablerepo=#{new_resource.repositoryid}"
action :nothing
end
# get the metadata for this repo only
execute "yum-makecache-#{new_resource.repositoryid}" do
command "yum -q makecache --disablerepo=* --enablerepo=#{new_resource.repositoryid}"
command "yum -q -y makecache --disablerepo=* --enablerepo=#{new_resource.repositoryid}"
action :nothing
only_if { new_resource.enabled }
end
@@ -74,11 +82,11 @@ end
action :delete do
file "/etc/yum.repos.d/#{new_resource.repositoryid}.repo" do
action :delete
notifies :run, "execute[yum clean #{new_resource.repositoryid}]", :immediately
notifies :run, "execute[yum clean all #{new_resource.repositoryid}]", :immediately
notifies :create, "ruby_block[yum-cache-reload-#{new_resource.repositoryid}]", :immediately
end
execute "yum clean #{new_resource.repositoryid}" do
execute "yum clean all #{new_resource.repositoryid}" do
command "yum clean all --disablerepo=* --enablerepo=#{new_resource.repositoryid}"
only_if "yum repolist | grep -P '^#{new_resource.repositoryid}([ \t]|$)'"
action :nothing