How to enable Inventory Cache plugin in Ansible?

0 votes
I'm working on an Ansible project. I'm a noob at Ansible and I am asked to enable inventory cache plugin, apparently, it's disabled.

How do I do that?
Feb 19, 2019 in Ansible by Prakash
566 views

2 answers to this question.

0 votes

Hey @Prakash, Inventory cache plugin is disabled by default, you explicitly have to enable it. 

You can enable it using the environment variable

export ANSIBLE_INVENTORY_CACHE=True
answered Feb 19, 2019 by farookh
0 votes

Adding to @Farookh's answer, if the inventory plugin accepts a YAML configuration source, you can also enable the inventory cache in the configuration file, something like this:

# dev.aws_ec2.yaml
plugin: aws_ec2
cache: True
answered Feb 19, 2019 by Shalaka

Related Questions In Ansible

0 votes
1 answer

How to regex replace nested values in Ansible

I'm not aware of any built-in method ...READ MORE

answered Jun 16, 2018 in Ansible by shubham
• 6,910 points
2,053 views
0 votes
1 answer

How to ignore failed commands in Ansible?

Usually, if even one command fails to ...READ MORE

answered Feb 7, 2019 in Ansible by Patt
8,337 views
0 votes
1 answer
+13 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 26, 2018 in DevOps & Agile by DragonLord999
• 8,420 points
610 views
0 votes
1 answer
0 votes
1 answer

How do I enable cache plugin in Ansible?

Hey @Jason, You can enable a cache plugin ...READ MORE

answered Feb 19, 2019 in Ansible by Yogesh
138 views
0 votes
1 answer

How to configure fact caching in Ansible?

There are two cache plugins: redis and jsonfile. To ...READ MORE

answered Jan 24, 2019 in Ansible by Kennedy
1,475 views