[chef] Re: Re: JSON Role files, attributes, and variable interpolation


Chronological Thread 
  • From: Mark Selby < >
  • To: " " < >
  • Subject: [chef] Re: Re: JSON Role files, attributes, and variable interpolation
  • Date: Tue, 30 Dec 2014 12:15:20 -0800

Thanks for the response

I do this already extensively in cookbooks and was hoping that I could extend to roles -- but such be life. 

On Tue, Dec 30, 2014 at 11:07 AM, Noah Kantrowitz < " target="_blank"> > wrote:
No, nor would this work in the ruby format. Role data must be purely static. You can do things like this in cookbooks though.

--Noah




On December 30, 2014 at 10:41:15 AM PST, Mark Selby < " target="_blank"> > wrote:
I use JSON based role files and for better or worse use them often  for attribute definition.

I have recently tried to perform variable interpolation like this

    "default_attributes": {
        "foo": {
            "server": "extra.#{node['fqdn']}"
          }
 
I was not surprised that this DID NOT work and that I got 'extra.#{node['fqdn']}' rather than an interpolated string.

Is there any way to interpolate in JSON role files?

Thanks




Archive powered by MHonArc 2.6.16.

§