You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying to use this cookbook and changing the node.default['mysqld']['service_name'] value, I get the following error
==> db: ================================================================================
==> db: Error executing action restart on resource 'service[mysql]'
==> db: ================================================================================
==> db:
==> db: Mixlib::ShellOut::ShellCommandFailed
==> db: ------------------------------------
==> db: Expected process to exit with [0], but received '5'
==> db: ---- Begin output of /bin/systemctl restart mysql ----
==> db: STDOUT:
==> db: STDERR: Failed to restart mysql.service: Unit not found.
==> db: ---- End output of /bin/systemctl restart mysql ----
==> db: Ran /bin/systemctl restart mysql returned 5
==> db:
==> db: Resource Declaration:
==> db: ---------------------
==> db: # In /tmp/vagrant-chef/824d535e25710db30ed17d906f18aa01/cookbooks/mysqld/providers/default.rb
==> db:
==> db: 48: service new_resource.service_name do
==> db: 49: # Use --wsrep-new-cluster if this is an initial galera startup
==> db: 50: if new_resource.galera_init
==> db: 51: start_command "service #{new_resource.service_name} start --wsrep-new-cluster --wsrep_cluster_address=gcomm://"
==> db: 52: end
==> db: 53:
==> db:
==> db: Compiled Resource:
==> db: ------------------
==> db: # Declared in /tmp/vagrant-chef/824d535e25710db30ed17d906f18aa01/cookbooks/mysqld/providers/default.rb:48:in `block in class_from_file'
==> db:
==> db: service("mysql") do
==> db: action [:enable, :start]
==> db: supports {:restart=>nil, :reload=>nil, :status=>nil}
==> db: retries 0
==> db: retry_delay 2
==> db: default_guard_interpreter :default
==> db: service_name "mysql"
==> db: pattern "mysql"
==> db: declared_type :service
==> db: cookbook_name :mysqld
==> db: not_if { #code block }
==> db: end
It looks as though the service name is still "mysql" instead of the value I pass through as node.default['mysqld']['service_name'] - in this instance, "mysqld"
The text was updated successfully, but these errors were encountered:
I suppose you are using the default recipe?
I found overriding the attributes in Chef sometimes rather weird, can you try node.override instead of node.default? Does that make a difference?
I personally found it a good practise to always use wrapper cookbooks and then use the providers, like so:
When trying to use this cookbook and changing the node.default['mysqld']['service_name'] value, I get the following error
It looks as though the service name is still "mysql" instead of the value I pass through as node.default['mysqld']['service_name'] - in this instance, "mysqld"
The text was updated successfully, but these errors were encountered: