From the course: Complete Guide to Configuration Management Using Ansible

Unlock this course with a free trial

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

Defining default settings in ansible.cfg

Defining default settings in ansible.cfg

Okay. So in the last lesson, you have learned how to set up your managed nodes, and you have seen that you can specify so many parameters on the command line. Now I would like to talk about ansible.cfg. That's the main configuration file, and if you configure it the right way, you don't have to type all these command line parameters anymore. Let's check it out. So default configuration, that is what ansible.cfg is all about. You can provide these settings through a generic default configuration in /etc/ansible/ansible.cfg. And if this generic ansible.cfg exists and is the only configuration; it applies to all Ansible projects. But it's very common in Ansible to work with a project directory. Let me give you a simple example. Let's say that you have an Ansible environment where you are managing Windows as well as Linux. Then it does make a lot of sense to create a Windows project directory as well as a Linux project directory. And each of these project directories is getting its own…

Contents