Nitpick, add to this:

<pre>
  class { 'elasticsearch::service': } ->
  Class['elasticsearch']
</pre>

Which "anchors" all of these other classes to happen before the elasticsearch one, meaning you can then depend on this top level class having been done.