Does Ansible have component akin to PuppetDB? I know Puppet from (limited) experience and have noticed that in configuration management there is now a strong trend towards Ansible.

On the one hand, I understand that Ansible does not require an agent, because it makes intelligent use of ssh. 

On the other hand, these are features have come to like about Puppet:


access to system-wide configuration state and history (PuppetDB) via REST API
ability to keep backups of overwritten files (filebuckets)
ability to encrypt part of the Hiera configurations (.eyaml)


Among these, PuppetDB seems to me the most important and useful (e.g. for integration with other tools). Therefore my question is this: Does Ansible have something akin to PuppetDB, i.e. a component that offers an API where it could e.g. be asked "What packages are installed on host x?" or "On which hosts is package y installed?"

(This question was migrated over from StackOverflow).

UPDATE Significant downside of Puppet it my experience so far: Not so much the fact that it requires an agent (from what I have seen, Ansible's use of Python also introduces an agent of sorts in the form of a Python interpreter ;-), but that it wants its agent to act as root only and always.
The direct answer is "no".

Ansible does not have any database, because it is supposed to be run by different operators from different computers and it's purpose is to be sure that target systems are in the exact state, as specified in playbooks.

There's an option to attach external facts cache backends to Ansible. So you can setup redis as your cache, Ansible will populate it with gathered facts during playbook run and you can later query redis for them. But it is very limited solution, because there are not too much facts gathered by Ansible, for example there are no information about installed packages – you will have to gather them yourself an use set_fact with cacheable option to put them into external cache.