Initial Chef repository

This commit is contained in:
Greg Karékinian
2015-07-21 19:45:23 +02:00
parent 7e5401fc71
commit ee4079fa85
1151 changed files with 185163 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
#
# Cookbook Name:: mariadb
# Provider:: configuration
#
use_inline_resources if defined?(use_inline_resources)
def whyrun_supported?
true
end
action :add do
variables_hash = {
section: new_resource.section,
options: new_resource.option
}
template node['mariadb']['configuration']['includedir'] + \
'/' + new_resource.name + '.cnf' do
source 'conf.d.generic.erb'
owner 'root'
group 'mysql'
mode '0640'
cookbook new_resource.cookbook
variables variables_hash
end
end
action :remove do
if ::File.exist?(node['mariadb']['configuration']['includedir'] + \
'/' + new_resource.name + '.cnf')
Chef::Log.info "Removing #{new_resource.name} repository from " + \
node['mariadb']['configuration']['includedir']
file node['mariadb']['configuration']['includedir'] + \
'/' + new_resource.name + '.cnf' do
action :delete
end
end
end