1

In my puppet class i use 3 create_resources. I want to execute these create_resources in order. Thus there are relationships between each other

create_resources(change_config::cr1, $resource)

create_resources(change_config::cr2, $resource)

create_resources(change_config::cr3, $resource)

cr3 should be executed after cr2 and cr2 should be after cr1.

Is there a way to do this ?

Regards, Malintha

Malintha
  • 4,512
  • 9
  • 48
  • 82

1 Answers1

5

You can use Puppet Collectors here. Simply add this line into your manifest:

Change_config::Cr1<| |> -> Change_config::Cr2<| |> -> Change_config::Cr3<| |>

It will order all Cr1's before 2's before 3s. You can even put extra filtering inside the <| |> like

Change_config::Cr1<| title == 'some_name' |> -> Change_config::Cr1<| <| title != 'some_name' |>
Sekm
  • 1,658
  • 13
  • 22
  • I use this solution. But this do only the first mentioned one. (Cr1). Other create_resource definitions are not working. then I changed the order ( put cr2 to first ). Then it do only Cr2. What is the reason for this ? – Malintha Aug 22 '14 at 10:19
  • This should work as I described. Can you copy your code here? – Sekm Aug 25 '14 at 03:04