Ansible 2.4 hostfile警告

Ken*_*ong 9 ansible

在Ansible 2.4中,我收到了这个弃用警告:

[DEPRECATION WARNING]: [defaults]hostfile option, The key is misleading as it can also be a list of hosts, a directory or a list of
paths . This feature will be removed in version 2.8. Deprecation warnings can be disabled by setting deprecation_warnings=False in
ansible.cfg.
Run Code Online (Sandbox Code Playgroud)

对于我的生活,我无法弄清楚这意味着什么.有人知道吗?

Ken*_*ong 14

在我的ansible.cfg文件中,我有一行像

hostfile = ./inventory
Run Code Online (Sandbox Code Playgroud)

这需要改为

inventory = ./inventory
Run Code Online (Sandbox Code Playgroud)

  • 正如您所知,`hostfile`已被弃用,以支持`inventory`:http://docs.ansible.com/ansible/latest/porting_guide_2.4.html#specifying-inventory-sources (2认同)