Próbuję zainstalować określone pod-wersje MySQL za pomocą przepisu. Ustawiłem atrybut węzła na 5.6 i uruchomiłem szefa-klienta na błędnym polu testowym, ale nie działa z następującym błędem:
==> default: Recipe: my-mysql::default
==> default: * mysql_service[testdb] action create
==> default: * mysql_server_installation_package[testdb] action install
==> default:
==> default: * yum_package[mysql-community-server] action install
==> default:
==> default: * No candidate version available for mysql-community-server
==> default:
==> default: ================================================================================
==> default: Error executing action `install` on resource 'yum_package[mysql-community-server]'
==> default: ================================================================================
==> default:
==> default: Chef::Exceptions::Package
==> default: -------------------------
==> default: No candidate version available for mysql-community-server
==> default:
==> default: Resource Declaration:
==> default: ---------------------
==> default: # In /var/chef/cache/cookbooks/mysql/libraries/mysql_server_installation_package.rb
==> default:
==> default: 17: package package_name do
==> default: 18: version package_version if package_version
==> default: 19: options package_options if package_options
==> default: 20: notifies :install, 'package[perl-Sys-Hostname-Long]', :immediately if platform_family?('suse')
==> default: 21: notifies :run, 'execute[Initial DB setup script]', :immediately if platform_family?('suse')
==> default: 22: action :install
==> default: 23: end
==> default: 24:
==> default:
==> default: Compiled Resource:
==> default: ------------------
==> default: # Declared in /var/chef/cache/cookbooks/mysql/libraries/mysql_server_installation_package.rb:17:in `block in <class:MysqlServerInstallationPackage>'
==> default:
==> default: yum_package("mysql-community-server") do
==> default: package_name "mysql-community-server"
==> default: action [:install]
==> default: retries 0
==> default: retry_delay 2
==> default: default_guard_interpreter :default
==> default: declared_type :package
==> default: cookbook_name "my-mysql"
==> default: version "5.6.29-2.el7"
==> default: flush_cache {:before=>false, :after=>false}
==> default: end
Mój przepis wykorzystuje książkę kucharską mysql (obecnie w wersji 8.0.4). Blok w moim przepisie na konfigurację mysql jest następujący:
mysql_service mysql_service_name do
version node['mysql']['version']
bind_address node['mysql']['bind_address']
port node['mysql']['port']
data_dir node['mysql']['data_dir']
initial_root_password 'test'
action [:create, :start]
end
Utworzyłem niestandardową rolę (dla uproszczenia) do użytku z obsługą Vagrant Chef. Oto domyślne atrybuty:
"default_attributes": {
"mysql": {
"version": "5.6",
"service_name": "testdb"
}
},
Czy ktoś wie o działających przykładach MySQL 5.6 / 5.7 zainstalowanych na Centos 7 przy użyciu Chef?