I use ansible and i have this configuration in my inventory

[master]
192.168.1.10 ansible_connection=ssh ansible_ssh_user=vagrant ansible_ssh_pass=vagrant

[slave]
192.168.1.11 ansible_connection=ssh ansible_ssh_user=vagrant ansible_ssh_pass=vagrant
192.168.1.12 ansible_connection=ssh ansible_ssh_user=vagrant ansible_ssh_pass=vagrant

[app]
192.168.1.13 ansible_connection=ssh ansible_ssh_user=vagrant ansible_ssh_pass=vagrant

[all:children]
master
slave

I don't want to repeat the same parameters for each new instance How do i configure them all in one place? Is there any file with these parameters?

Best Answer


You can add the following section to your stock file

[all:vars]
ansible_connection=ssh
ansible_user=vagrant
ansible_ssh_pass=vagrant

Note: Before Ansible 2.0 ansible_user was ansible_ssh_user .