cloud-init module order is wrong, how to fix?

I hit the same bug #1231541. As I had the problem in OpenStack, I used packer to rebuild the image and change the order of the cloud-init modules. Afterwards everything worked as expected.