Implemented usage of ruby sorting for yaml file

This prevents the file to be rewritten only because of a ordering
change in the yaml parameters as this might cause service refreshes to
be triggered.

refs #71209