Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ansible.inventory.path behavior should change #10948

Open
jzielke84 opened this issue Jul 3, 2019 · 0 comments
Open

ansible.inventory.path behavior should change #10948

jzielke84 opened this issue Jul 3, 2019 · 0 comments

Comments

@jzielke84
Copy link

Vagrant version

2.2.4

Host operating system

Mac OS X 10.14.5 running latest ohmy-zsh and Ansible 2.8.1

Guest operating system

debian stretch 64 contrib image

Vagrantfile

      config.vm.provision           "ansible" do |ansible|
        ansible.verbose           = false
        ansible.playbook          = "../../ansible/stretch.yml"
        ansible.inventory_path    = "192.168.50.10,"
        ansible.inventory_path    = "../../ansible/env_vag"
      end

Debug output

 INFO subprocess: Starting process: ["/usr/local/bin/ansible-playbook", "--connection=ssh", "--timeout=30", "--extra-vars=ansible_user='vagrant'", "--limit=stretch", "--inventory-file=../../ansible/env_vag", "../../ansible/stretch.yml"]

Expected behavior

ansible.inventory.path should be changed to ansible.inventory, making Vagrant pass the --inventory <...> argument. This would match the same behavior as Ansible itself does (the inventory-file argument is deprecated anyway).

Quote from Ansible help:

-i INVENTORY, --inventory=INVENTORY, --inventory-file=INVENTORY
specify inventory host path or comma separated host
list. --inventory-file is deprecated

Actual behavior

When using ansible.inventory.path with an IP, Vagrant looks up the inventory file and changes the ansible-playbook argument to --limit=<hostname>". Although this works fine, the description of ansible.inventory.path and Vagrant's actual behavior is confusing.

@jzielke84 jzielke84 changed the title ansible.inventory should contain IP ansible.inventory.path behavior should change Jul 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants