7

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.

  • Curious: how would you expect a tool like Puppet (or Chef, or CFEngine) to be able to do what it does without running as root? It replaces the need for a SA to login and do things manually, therefore it must be able to do anything an SA can do. – Gaius Dec 8 '17 at 21:30
  • @Gaius For one thing, I know a who does not have root access rights on a server cluster, but still can use Ansible for managing a large web application there. Besides, there are SAs who do not log in as root, but use sudo more sparsingly instead. – Drux Dec 8 '17 at 21:39
  • They do still need to run commands as root then. If the agent running is a dealbreaker for you, then you are mis-applying the tool – Gaius Dec 10 '17 at 7:07
5

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.

| improve this answer | |
  • 1
    Thx. I don't understand the "because" in your 2nd paragraph: Puppet would IMO also claim that "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" (only that it would speak of manifests instead of playbooks), yet it uses a database. – Drux Dec 8 '17 at 8:36
  • I meant "without any central/shared component". So in Ansible you don't have any stateful component except target system. – Konstantin Suvorov Dec 8 '17 at 8:40
  • I see, that makes sense. – Drux Dec 8 '17 at 8:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.