From the course: Ansible: From Basics to Guru by Pearson

Unlock this course with a free trial

Join today to access over 25,200 courses taught by industry experts.

Case study: Optimizing Ansible

Case study: Optimizing Ansible

All right, let's check out a situation where Ansible is behaving poorly. So I have my Git repository and in there I've copy YAML. It's more or less a random playbook that I'm running, Ansible playbook on copy.yml. And what do we see? Gathering facts. It's taking a long time, normally that is instantaneous. So what is going on if gathering facts takes a long time? Well, of course, we can configure fact caching or use gatherFactsNode. But if you do want to use fact gathering, you need to think about what is going on. Is this something that is related to security? No, not really. Also not to SSH sessions. This is more about hostname lookup. Do we have hostname lookup? Well, Ansible on all minus A. Let's just start with an LS minus L ETC hosts. Do we even have an ETC host? And look at that on Ansible one, we don't have an ETC host. Well, that explains a lot. For this demo, I removed ETC host. In case you have this type of problem, it may also be that you do have an ETC host that just…

Contents