I'm trying to unwind a part of a chef recipe from an upstream cookbook (ceph) in my wrapper cookbook recipe. In brief summary, the ceph user pool create block is being executed too early in the deployment, before certain required services are up and running. I'm moving it out into a new wrapper recipe which will be executed further down the runlist, when the services are running.
To this end, I'm trying to rewind the below block from the ceph::mon upstream recipe and then execute it at a later point in my new wrapper recipe. My code is currently as follows:
include_recipe 'workday::chef-client'
require 'chef/rewind'
include_recipe 'ceph::mon'
if node['ceph']['user_pools']
# Create user-defined pools
node['ceph']['user_pools'].each do |pool|
ceph_pool pool['name'] do
unwind "pool"
pg_num pool['pg_num']
create_options pool['create_options'] if pool['create_options']
end
end
end
The error output from chef-client:
NoMethodError
-------------
undefined method `unwind' for Chef::Resource::CephPool
I've attempted various unwind statements: e.g.
unwind "ceph_pool pool['name']"
unwind "pool['name']"
I have previously used unwind/rewind on resources (e.g. "execute x") but I am not sure how to correctly unwind this. I've read the limited docs that are available from chef-rewind, but I cannot find a solution for this.