Update cookbooks for Ubuntu 16.04 TLS
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
property :mysql2_chef_gem_name, String, name_attribute: true, required: true
|
||||
property :gem_version, String, default: '0.4.5'
|
||||
property :package_version, String
|
||||
|
||||
provides :mysql2_chef_gem_mariadb
|
||||
|
||||
action :install do
|
||||
recipe_eval do
|
||||
run_context.include_recipe 'build-essential::default'
|
||||
end
|
||||
|
||||
# As a recipe: must rely on global node attributes
|
||||
recipe_eval do
|
||||
run_context.include_recipe 'mariadb::client'
|
||||
end
|
||||
|
||||
gem_package 'mysql2' do
|
||||
gem_binary RbConfig::CONFIG['bindir'] + '/gem'
|
||||
version new_resource.gem_version
|
||||
action :install
|
||||
end
|
||||
end
|
||||
|
||||
action :remove do
|
||||
gem_package 'mysql2' do
|
||||
gem_binary RbConfig::CONFIG['bindir'] + '/gem'
|
||||
action :remove
|
||||
end
|
||||
end
|
||||
29
cookbooks/mysql2_chef_gem/resources/mysql2_chef_gem_mysql.rb
Normal file
29
cookbooks/mysql2_chef_gem/resources/mysql2_chef_gem_mysql.rb
Normal file
@@ -0,0 +1,29 @@
|
||||
property :mysql2_chef_gem_name, String, name_attribute: true, required: true
|
||||
property :gem_version, String, default: '0.4.5'
|
||||
property :package_version, String
|
||||
|
||||
provides :mysql2_chef_gem
|
||||
provides :mysql2_chef_gem_mysql
|
||||
|
||||
action :install do
|
||||
include_recipe 'build-essential::default'
|
||||
|
||||
# As a resource: can pass version from calling recipe
|
||||
mysql_client 'default' do
|
||||
version new_resource.package_version if new_resource.package_version
|
||||
action :create
|
||||
end
|
||||
|
||||
gem_package 'mysql2' do
|
||||
gem_binary RbConfig::CONFIG['bindir'] + '/gem'
|
||||
version new_resource.gem_version
|
||||
action :install
|
||||
end
|
||||
end
|
||||
|
||||
action :remove do
|
||||
gem_package 'mysql2' do
|
||||
gem_binary RbConfig::CONFIG['bindir'] + '/gem'
|
||||
action :remove
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user