- From: Daniel DeLeo <
>
- To:
- Subject: [chef] Re: Changing the order of 'run_list'
- Date: Fri, 5 Jun 2015 08:19:56 -0700
On Friday, June 5, 2015 at 8:01 AM, Tiago Cruz wrote:
>
Ohai!
>
>
To add one recipe before other, I can use:
>
>
knife node run_list add lasvegas1 'role[base]' --before 'role[web]'
>
>
But I can't do this using recipe:
>
>
if not node.run_list.roles.include?('base')
>
ruby_block "Add base role before web" do
>
block { node.run_list.add("role[base]").before("role[web]") }
>
end
>
end
>
>
How can I do this?
>
>
Thanks!
>
>
--
>
-- Tiago Cruz
The run list is just a ruby array, use ruby’s Array methods for this.
http://ruby-doc.org/core-2.2.0/Array.html#method-i-insert
--
Daniel DeLeo
Archive powered by MHonArc 2.6.16.