In this video, we will take a look at Ansible configuration file.
Every application or package that is installed on any operating system comes with a configuration file.
And I would say nine out of ten times those packages will always have a configuration file.
Ansible Just like any package when installed on your operating system, it has its own configuration
file as well.
Some of the most common parameters that can be defined in Ansible, CFG and short for configuration
file is asphalt.
So you could define the list of these parameters in your configuration file, but if you go into your
configuration file and cat it and try to read it, you will see none of the parameters that are defined
right here, which I'm going through.
You could add them in there, but by default the configuration file comes empty or it has comments in
it.
So the very first parameters and by the way, these are just a common parameters you could define.
You could change it, you could remove it.
It depends on your system or your environment requirement.
All right.
So the first one, let's take a look.
Remote underscore user equal ansible.
Then you had that parameter set up in your configuration file.
It means it's a name of the user account used to connect to your remote clients.
Then we have host underscore key underscore checking equal false, which means it specifies whether
a search key or host key should be checked.
So if a host is reinstalled and has a different key in known underscore host file where the keys are.
This will result in an error message until corrected.
So when you have it false, then it will skip that part.
Then you have the inventory.
This is where you specify the location of your inventory file.
You could change the default location from Ansible and host file to any location of your choice.
And you can specify right here in ansible cfg file.
If you do not specify then will take it by the default one or it will take it that you specify what
by minus I option, which by the way, we will cover later on.
Then you have additional parameters for privilege escalations.
Some of them like become equal.
True, which means whether escalation is needed for root and if it does, how it's going to change it.
What should be used on a local or client system for privileged access?
Then when become user, what user should become and it should be root, which is the administrative
account on Linux machine, which indicates that the name of the user account used to run escalated commands.
All right, so when we are running escalated command, then you specify this parameters which tells
you or prompts you for root need a password for root needed when running escalated commands.
So if you specify false then of course it will not prompt you for root password.
So this is a very common, very basic configuration parameters that you could specify in your configuration
file.
But as a beginner I would say you could leave the Ansible dot cfg file as is and you could make changes
to it once you have a good understanding of how ansible automation works.