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

前端 未结 9 1158

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:23

    You can run your playbook in verbose mode by adding -vvvv in the end. Ansible uses host file from /etc/ansible/hosts add the below

    You can check what inventory file is being used by your ansible by below

    ansible --version
    ansible 2.0.0.2
    config file = /etc/ansible/ansible.cfg
    configured module search path = Default w/o overrides
    

    Then check your host file if it contains the exact group for host

     vim /etc/ansible/hosts
     [webserver1]
     IP of machine
    

    check by running the below command

    ansible -m ping 10.0.3.145 (IP Of machine)
    10.0.3.145 | SUCCESS => {
    "changed": false, 
    "ping": "pong"
    

    }

    This should fix the issue.

提交回复
热议问题