ansible-inventory-puppetdb
ansible-inventory-puppetdb copied to clipboard
TypeError: connect() got an unexpected keyword argument 'api_version'
Thanks for your work on this and I'm hoping I can get it working. I updated puppetdb.yml with my info:
host: 10.2.0.10
api_version: 3
port: 8081
timeout: 10
ssl_verify: False
ssl_key:
ssl_cert:
cache_file: '/tmp/ansible-inventory-puppetdb.cache'
cache_duration: 30
group_by:
group_by_tag:
but when I run ./puppetdb.py --list
I get:
Traceback (most recent call last): File "./puppetdb.py", line 234, in <module> main() File "./puppetdb.py", line 226, in main inventory = PuppetdbInventory(args.refresh) File "./puppetdb.py", line 86, in __init__ self.puppetdb = connect(**puppetdb_config) TypeError: connect() got an unexpected keyword argument 'api_version'
Any ideas?
Your running the newer version of pypuppetdb
Make sure you install the 0.1.1 branch not master and this will resolve itself.
Gotcha, I will give that a try, thank you for the response!
Hi @Techcadia ,I think version 0.1.1 doesn't support puppetdb 4.0., any chance to update script for using pypuppetdb 0.2.2 and puppetdb api version 4?
I think this was fixed by https://github.com/dmsimard/ansible-inventory-puppetdb/pull/5 - it's been merged.
I may be mistaken, but doesn't #5 make this incompatible with the 0.1.x version of pypuppetdb (which needs the api_version)? I don't have an older version setup to test with, but I can do a pr, which should allow both versions of pypuppetdb to work.
A backwards compatible change would be welcome.
PR #6 should allow both versions of pypuppetdb to work. I've used it with Puppet DB 4, but unfortunately don't have access to an older install to test that with.