Olumayowa A.
Olumayowa A.

Reputation: 62

vim /etc/ansbile/ansible.cfg opens an empty file instead of the default ansible.cfg

While following a training, I ran vim /etc/ansbile/ansible.cfg on my Mac.

In the training video, this command loads a default ansible configuration file while on my Mac it came back with a blank page.

How can I get a default config file to start editing it?

Upvotes: 2

Views: 2515

Answers (1)

Zeitounator
Zeitounator

Reputation: 44740

There is no default ansible configuration file by default. In other words, ansible does not create any system wide configuration file at install and will use default values for all parameters if run without any existing configuration file (system wide, user home, project level...)

Since you are trying to edit a file which does not exist, vim starts with an empty buffer to create a new file.

You can easily create an ansible.cfg file containing commented out default values of all known parameters and store it wherever you like with the following command:

ansible-config init --disabled -f ini > /tmp/ansible.cfg

Upvotes: 4

Related Questions