Clean up heat env file code (overcloud)

There's a lot of boilerplate in this section of code which makes it a
bit hard to read and increases the chance of inconsistencies creeping
in. Also jq is called about 20 times when it only needs to be called
twice.

(Overcloud; undercloud version at
I09cb2dfad514c85feffd1ed7fee7a059879a091a)

Change-Id: I6d7a7081e15452f1ca090610a3a068cfe30b531b
Merge "Clean up heat env file code (overcloud)"