Hammer import-templates not working when executed by puppet

Problem:

Puppet is putting snippet files into a custom repository directory and notifies an exec that runs hammer import-templates

Expected outcome:
Tempates will be updates in front end UI when puppet updates them on the back end.

Foreman and Proxy versions:
Foreman 3.5 Katello 4.7
Foreman and Proxy plugin versions:

Distribution and version:
Redhat 8

Other relevant data:
When I execute puppet with the --debug option, I can see that removing a file in the folder triggers puppet to put the file back in the custom repo directory and notifies my exec code which executes hammer import-template command. However, the file doesn’t show up in the UI.

If I tee the output to a custom log and copy paste the /usr/bin/hammer import template command puppet is running to my bash shell, it works immediately. This is quite maddening and I’m wondering if anyone has encountered this. Cobbler used to just manage a folder automatically and when the files were changed it would immediately update the front end. When I run the command I’m in root bash and puppet would also be executing as root. I’ve never had exec not work before through puppet.