We're waiting on https://github.com/theforeman/foreman/pull/631 to be merged to do this over the API. Sadly that's unlikely to get into the 1.2 Foreman release.

I'll add similar sed magic for now.