This is a known design problem in Puppet. Simple resources (eg. file or package) do get included in the correct order because they are contained. However, the same idea of containment doesn't apply to classes because you can include them in more than one place.

Luckily, there is a workaround called the Anchor Pattern. By modifying a contained resource so that is has an explicit require relationship with the classes you want to include ...(more)