Ansible: overriding values ​​in all.yml

From what I can put together, ansible lets you parameterize things

  • in group_vars / all.yml
  • in playbooks
  • cast

However, it seems that when we try to override the value (using -extra-vars), all.yml options are not replaced. That is, I have a recipe similar to this:

├── README.md
├── cluster.yml
├── group_vars
│   ├── all.yml

Then i call

/usr/local/bin/ansible-playbook --private-key=/Users/jayunit100/.ssh/id_rsa --user=fedora --connection=ssh --limit=all --inventory-file=/Users/jayunit100/Development/kubernetes/contrib/ansible/vagrant/... --extra-vars={\"ansible_ssh_user\":\"fedora\",\"dns_setup\":\"false\"}" ../cluster.yml"

In my case, it seems that roles using ansible_ssh_user use the values ​​from all.yml and not into -extra-vars. Are all.yml values ​​relevant for overriding?

POSSIBLE RELATED

There seem to be a few questions / errors around the priority in the inaccessible (e.g. https://github.com/ansible/ansible/issues/9877 ), so there may not be a “right” answer to this question without specifying the version. In my case its 1.9.2.

+4
1

, --extra-vars JSON:

ansible-playbook ... --extra-vars='{"ansible_ssh_user":"root", "dns_setup":"false"}' ...
+1

All Articles