[chef] Changing the order of 'run_list'


Chronological Thread 
  • From: Tiago Cruz < >
  • To: " " < >
  • Subject: [chef] Changing the order of 'run_list'
  • Date: Fri, 5 Jun 2015 12:01:18 -0300

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




Archive powered by MHonArc 2.6.16.

§