Skip to content

Commit

Permalink
Merge pull request #186 from engineyard/fbz-10538-add-report
Browse files Browse the repository at this point in the history
[fbz-10538] Add chef status report in Database recipes
  • Loading branch information
rupikakapoor committed Feb 16, 2023
2 parents b1eb618 + 9ca1d3e commit c59d44f
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 2 deletions.
8 changes: 8 additions & 0 deletions cookbooks/ey-db-ssl/recipes/setup.rb
Expand Up @@ -9,6 +9,10 @@
dbroot = node[keyname]["dbroot"]
ssldir = node[keyname]["ssldir"]

ey_cloud_report "db ssl keys" do
message "processing ssl keys started"
end

managed_template "/engineyard/bin/local_key_copy.sh" do
owner "root"
group "root"
Expand Down Expand Up @@ -98,3 +102,7 @@
command "/engineyard/bin/local_key_copy.sh #{node['dna']['users'].first['username']}"
only_if { ::File.exist?(::File.join(ssldir, "root.crt")) and ::File.exist?(::File.join(dbroot, "keygen", node["dna"]["users"].first["username"], "#{keyname}.key")) }
end

ey_cloud_report "db ssl keys" do
message "processing ssl keys finished"
end
8 changes: 8 additions & 0 deletions cookbooks/ey-db_admin_tools/recipes/default.rb
@@ -1,6 +1,14 @@
ey_cloud_report "db admin tools" do
message "processing db tools started"
end

case node.engineyard.environment["db_stack_name"]
when /mysql/
include_recipe "ey-db_admin_tools::mysql"
when /postgres/
include_recipe "ey-db_admin_tools::postgres"
end

ey_cloud_report "db admin tools" do
message "processing db tools finished"
end
8 changes: 8 additions & 0 deletions cookbooks/ey-mysql/recipes/default.rb
@@ -1,6 +1,10 @@
include_recipe "ey-ebs::default"
innodb_buff = calc_innodb_buffer_pool()

ey_cloud_report "mysql config" do
message "mysql config and dir creation started"
end

if node.engineyard.instance.arch_type == "arm64"
raise "Graviton instances are not supported for MySQL currently!"
end
Expand Down Expand Up @@ -109,4 +113,8 @@
owner "mysql"
group "mysql"
mode "755"
end

ey_cloud_report "mysql config" do
message "mysql config and dir creation finished"
end
11 changes: 10 additions & 1 deletion cookbooks/ey-mysql/recipes/install.rb
@@ -1,3 +1,7 @@
ey_cloud_report "mysql installation" do
message "installation of mysql packages and dependencies started"
end

apt_repository "mysql57" do
uri "http://repo.percona.com/ps-57/apt"
distribution "#{`lsb_release -cs`.strip}"
Expand Down Expand Up @@ -95,11 +99,16 @@
only_if { node.engineyard.instance.arch_type == "amd64" }
end
end

ey_cloud_report "mysql installation" do
message "installation of mysql packages and dependencies finished"
end

if node["dna"]["instance_role"][/^(db|solo)/] && node["mysql"]["short_version"] == "8.0"
bash "Set my.cnf alternatives for MySQL 8.0" do
code <<-EOS
update-alternatives --install /etc/mysql/my.cnf my.cnf /etc/mysql/percona-server.cnf 1000
update-alternatives --set my.cnf /etc/mysql/percona-server.cnf
EOS
end
end
end
6 changes: 5 additions & 1 deletion cookbooks/ey-mysql/recipes/monitoring.rb
@@ -1,5 +1,5 @@
ey_cloud_report "mysql monitoring" do
message "processing mysql monitoring"
message "processing mysql monitoring started"
end

template "/engineyard/bin/check_mysql.sh" do
Expand All @@ -12,3 +12,7 @@
dbpass: node.engineyard.environment["db_admin_password"],
})
end

ey_cloud_report "mysql monitoring" do
message "processing mysql monitoring finished"
end
7 changes: 7 additions & 0 deletions cookbooks/ey-mysql/recipes/user_my.cnf.rb
Expand Up @@ -5,6 +5,9 @@
# Copyright:: 2008, Engine Yard, Inc.
#
# All rights reserved - Do Not Redistribute
ey_cloud_report "db user config" do
message "setting up user configuration started"
end

template "/root/.my.cnf" do
owner "root"
Expand Down Expand Up @@ -35,3 +38,7 @@
})
source "user_my.cnf.erb"
end

ey_cloud_report "db user config" do
message "setting up user configuration finished"
end

0 comments on commit c59d44f

Please sign in to comment.