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 20, 2019 in Ansible by Prakash
2,403 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 20, 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 20, 2019 by Shalaka

Related Questions In Ansible

0 votes
1 answer

How to set dynamic host inventory file for docker in Ansible?

Hi@akhtar, In a configuration especially a container setup such ...READ MORE

answered Sep 20, 2020 in Ansible by MD
• 95,460 points
2,037 views
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 17, 2018 in Ansible by shubham
• 7,340 points
5,536 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
15,707 views
0 votes
1 answer
+15 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 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
4,062 views
+2 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 20, 2019 in Ansible by Yogesh
856 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
4,051 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP