Skip to content

Local cachíng of Ansible Facts

Every time Ansible runs a Playbook, the first step (by default) is gathering facts about the target system:

PLAY [all-systems]

TASK [Gathering Facts]
ok: [host1]
ok: [host2]

This step is implicit, and it is not necessary (but possible) to add the gather facts step to every Playbook. The module which retrieves all the information is "setup", and by default it tries to gather as much information about the target system as possible. When the "setup" task is added as an extra step in the Playbook, the information about the destination system is refreshed and updated:

  tasks:
    - name: Refresh destination information
      setup:

That might be necessary when a Playbook changed vital system settings.

Gathering the facts is a time-consuming process, and for a short Playbook it is quite possible that this is the longest-running task. And it's repeated every time the Playbook runs.

Ansible provides Cache plugins which can store the gathered facts. If the system facts don't change between Playbook runs, this will greatly speed up the runtime of Playbooks. The facts cache can be stored in JSON files, in a Redis DB, in a Memcache, and a few other options. The simplest way, without additional tools required, is the "jsonfile" cache. Central implementations like Redis or Memcache allow multiple Ansible controller hosts to use the same facts cache, whereas local caches like "JSON" are only available on a single host, and every Ansible controller must build and maintain it's own cache.

 

Continue reading "Local cachíng of Ansible Facts"

How to clear the cached data in Android - without any App

Up until recently I was using an App to clean the the Android cache once in a while. If you don't, the device over time get's sluggish, because too many apps store too much data in the cache. Over time this cache can grow to GBs in size.

On the other hand, every single "clean cache App", over time, started showing more and more aggresive advertising. I get that the developer wants to make some money, that's fine. But maybe the money is not enough, so more advertising it is.

Turns out, there is a built-in way in Android to clean the cache. No need for an extra App.

 

 

Continue reading "How to clear the cached data in Android - without any App"