ansible playbook:错误:提供的主机列表为空
当我运行ansible playbook:错误:提供的主机列表为空,ansible,Ansible,当我运行ansible playbook web\u db.yaml时,我得到 ERROR: provided hosts list is empty 知道为什么吗 一些补充资料: $ ls -l -rw-r--r-- 1 vagrant vagrant 100 Aug 4 14:55 ansible.cfg -rw-rw-r-- 1 vagrant vagrant 222 Oct 20 2016 inventory -rw-rw-r-- 1 vagrant vagrant 531 May
ansible playbook web\u db.yaml
时,我得到
ERROR: provided hosts list is empty
知道为什么吗
一些补充资料:
$ ls -l
-rw-r--r-- 1 vagrant vagrant 100 Aug 4 14:55 ansible.cfg
-rw-rw-r-- 1 vagrant vagrant 222 Oct 20 2016 inventory
-rw-rw-r-- 1 vagrant vagrant 531 May 3 11:58 web_db.yaml
$ pwd
/home/vagrant/exercise1/production
$ cat inventory
web1 ansible_ssh_host=192.168.33.20
[webservers]
web1
$ cat ansible.cfg
[defaults]
inventory = /home/vagrant/exercise1/production/inventory
host_key_checking = False
$ ansible --version
ansible 1.5.4
$ cat web_db.yaml
---
- hosts: webservers
sudo: yes
就我所记得的,古老的Ansible版本使用参数而不是
库存
试一试
hostfile = /home/vagrant/exercise1/production/inventory
在你的配置中。你的ansible版本真的很旧…我也有同样的问题。此用户正在学习pluralsight的在线课程。添加hostfile对我很有效,我也在使用Ansible 1.5.4版