“skipping: no hosts matched” issue with Vagrant and Ansible

前端 未结 9 1156

I have installed Vagrant, VirtualBox and Ansible and trying to run provision over one host but it always returns \"skipping: no hosts matched\"

The head of my playbook f

9条回答
  •  一整个雨季
    2021-02-05 03:34

    It could help to post your Vagrantfile and your ansible inventory file.

    • Are you using the default ansible provider of vagrant?

      did you specify the inventory_path?

     config.vm.provision :ansible do |ansible|
       ansible.playbook = "provisioning/playbook.yml"
       ansible.inventory_path = "provisioning/ansible_hosts"
     end
    
    • Are you launching it the through the a vagrant ssh with --connection=local try a /etc/ansible/hosts
    [webserver1]
    127.0.0.1              ansible_connection=local
    
    • Are you using the ansibleLocal provider / vagrant plugin?

提交回复
热议问题