问题原文
原帖链接 · Robert · CC BY-SA 3.0
I am using Ansible and I have this configuration in my inventory/all:
[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 all the parameters for each new instance. How can I configure them just in one place? Is there any file with these parameters?
已采纳解答
原帖链接 · Alexey Labzov · CC BY-SA 4.0
You can add following section to your inventory file:
[all:vars]
ansible_connection=ssh
ansible_user=vagrant
ansible_ssh_pass=vagrant
Note: Before Ansible 2.0 ansible_user was ansible_ssh_user.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
