You should have a look at [puppet-syntax](https://github.com/gds-operations/puppet-syntax) since it's a lot faster than calling things in shell.