https://github.com/willingminds/lmapi-scripts
See lm-get-configs and the run-lm-get-configs wrapper. There are a fair number of workarounds in the main script due to various problems with module behavior. I am currently battling an apparent API bug where the query we use (basically, sort in reverse by version and provide the first result) triggers a bizarre "too many predicates" error. Sent that back to dev when they wanted to wash their hands of it because our API code is in Perl and is "unsupported".
To use the API module, you need a .lmapi file in the caller's home directly with one set of credentials per portal in YAML. For example:
---
companies:
willingminds:
access_id: '****'
access_key: '****'
The wrapper runs the script and checks into git -- not necessary, but we want to track changes and have post-commit hooks to get email reports on what changed. This was the original reason we wrote it, but it is also super helpful to be able to scan all configs at once with grep or with template-validation tools, etc.