Thats the part I was missing. Enabling it in the site config.
Looks like it's working but on checking the headers, I don't get the X-Robots-Tag.
I added a new line to the directive like this to test it:
Header set X-Robots-Tag "noindex, nofollow" env=temporary_domain
Header set MyHeader "Hello. It took %D microseconds for Apache to serve this request."
The headers show:
MyHeader: Hello. It took D=4463 microseconds for Apache to serve this request.
So the directive is loaded. Should I be able to see the X-Robots-Tag in the headers?