Is it possible to refer to chef attributes from the same attribute file?

If I have an attribute:

default [: mycookbook] [: attr_foo] = "foo"

can i access it in the same file, something like this:

default [: mycookbook] [: attr_bar] = default [: mycookbook] [: attr_foo]

+4
source share
1 answer

This is possible, however the correct syntax is:

default [: mycookbook] [: attr_bar] = "# {default [: mycookbook] [: attr_foo]}"

.. essentially the attribute is wrapped:

"# {}"

+1
source

Source: https://habr.com/ru/post/1537431/


All Articles