chef/cookbooks/mariadb/recipes/_debian_server.rb
Greg Karékinian a32f34b408 Vendor the external cookbooks
Knife-Zero doesn't include Berkshelf support, so vendoring everything in
the repo is convenient again
2019-10-13 19:17:42 +02:00

56 lines
1.5 KiB
Ruby

#
# Cookbook Name:: mariadb
# Recipe:: _debian_server
#
# Copyright 2014, blablacar.com
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# To be sure that debconf is installed
package 'debconf-utils' do
action :install
end
# Preseed Debian Package
# (but test for resource, as it can be declared by apt recipe)
begin
resources(directory: '/var/cache/local/preseeding')
rescue Chef::Exceptions::ResourceNotFound
directory '/var/cache/local/preseeding' do
owner 'root'
group 'root'
mode '0755'
recursive true
end
end
template '/var/cache/local/preseeding/mariadb-server.seed' do
source 'mariadb-server.seed.erb'
owner 'root'
group 'root'
mode '0600'
variables(package_name: 'mariadb-server')
notifies :run, 'execute[preseed mariadb-server]', :immediately
end
execute 'preseed mariadb-server' do
command '/usr/bin/debconf-set-selections ' \
'/var/cache/local/preseeding/mariadb-server.seed'
action :nothing
end
package "mariadb-server-#{node['mariadb']['install']['version']}" do
action :install
end