I’m working on a cookbook with a template that has some conditional logic driven by the version of mysql. A recipe installs mysql and then renders a file from the template. There used to be a “default_version_for” function that would provide the default version of mysql to install on a given OS, but this function has been removed, presumably because if the version is not specified, the default version for the OS is automatically installed. However, now that the function is gone, I’m wondering how to obtain the version of mysql that was installed when no version is specified. I tried getting the resource via:
server_resource = resources(mysql_service: node[‘mysql’][‘service_name’])
and then accessing the version using:
However, that returns nil. How can instance-variable values be retrieved from resources?