- From: Sean OMeara <
>
- To: "
" <
>
- Subject: [chef] Re: Retrieve values from resources
- Date: Thu, 4 Sep 2014 17:11:49 -0400
r = mysql_resource 'default'
r.parsed_version
-s
On Thu, Sep 4, 2014 at 4:58 PM, John Warren
<
>
wrote:
>
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:
>
>
server_resource.version
>
>
However, that returns nil. How can instance-variable values be retrieved
>
from resources?
>
>
Thanks,
>
>
John
Archive powered by MHonArc 2.6.16.