Is there any way to delay a resource's attribute resolution until the “execute” phase?

后端 未结 2 1344
一整个雨季
一整个雨季 2021-02-20 02:48

I have two LWRPs. The first deals with creating a disk volume, formatting it, and mounting it on a virtual machine, we\'ll call this resource cloud_volume. The seco

2条回答
  •  孤城傲影
    2021-02-20 03:30

    A cleaner way would be to use Lazy Attribute Evaluation. This will evaluate node[:volumes][mount_point][:uuid] during execution time instead of compile

    foobar "#{mount_point}" do
      disk_uuid lazy { node[:volumes][mount_point][:uuid] }
      action [:do_stuff]
    end
    

提交回复
热议问题