Skip to content

Provides a Redis-based cache for ansible fact data that is used by the custom inventory script.

Notifications You must be signed in to change notification settings

johanwiren/ansible-factcache

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

ansible-factcache

A callback plugin and a custom inventory script used to store and fetch ansible fact data in Redis.

Requirements

  • A running redis instance

Installation

  • Copy inventory.py to lib/ansible/callback_plugins
  • Copy facts_to_groups.py to /etc/ansible/hosts/ or just use it as your inventory script.

Usage

When installed, run ansible -m setup all to collect all facts to the cache. When the cache is populated, you can start doing some interesting ad-hoc commands:

ansible -m shell -a "yum -y upgrade" "ansible_os_family_RedHat:&ansible_distribution_version_6.0"

Or use them in your playbooks:

- hosts: ansible_system_OpenBSD
  tasks: 
    - debug: msg="Wow, this machine is awesome"

Bugs

Only simple facts are stored, no hashes or lists.

About

Provides a Redis-based cache for ansible fact data that is used by the custom inventory script.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages