Move hiera datadir logic into template.