I think you will want to take a look at - https://github.com/Katello/katello/pull/3607 and make adjustments accordingly with this file and the other above.