我最近配置了 Ansible AWX,/etc/ansible 上的主机文件由两个服务器组填充:
[ovirtmanager]
10.0.0.10
[ovirthv]
10.0.0.100
10.0.0.101
通过 CLI 我名为 check-service-status.yml 的剧本正确运行
---
- hosts: ovirthv
become: no
gather_facts: yes
tasks:
- name: "Populate service facts"
service_facts:
- name: "See if the service <lldpad> is up and running"
debug:
msg: "{{ansible_facts.services['lldpad.service'].state}}"
- name: "See if the service <fcoe> is up and running"
debug:
msg: "{{ansible_facts.services['fcoe.service'].state}}"
使用 WebGUI 我收到以下消息:
[WARNING]: Could not match supplied host pattern, ignoring: ovirthv
PLAY [ovirthv] *****************************************************************
skipping: no hosts matched
PLAY RECAP *********************************************************************
我怎么解决这个问题?怎么了?非常感谢!
更新:这是通过 WebGUI 执行的剧本
ansible-playbook 2.9.18
config file = /etc/ansible/ansible.cfg
configured module search path = ['/var/lib/awx/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python3.6/site-packages/ansible
executable location = /usr/bin/ansible-playbook
python version = 3.6.8 (default, Aug 24 2020, 17:57:11) [GCC 8.3.1 20191121 (Red Hat 8.3.1-5)]
Using /etc/ansible/ansible.cfg as config file
host_list declined parsing /tmp/bwrap_81_i8uuuftw/awx_81_j5jul0vn/tmpn1f0jauv as it did not pass its verify_file() method
Parsed /tmp/bwrap_81_i8uuuftw/awx_81_j5jul0vn/tmpn1f0jauv inventory source with script plugin
Skipping callback 'actionable', as we already have a stdout callback.
Skipping callback 'awx_display', as we already have a stdout callback.
Skipping callback 'counter_enabled', as we already have a stdout callback.
Skipping callback 'debug', as we already have a stdout callback.
Skipping callback 'dense', as we already have a stdout callback.
Skipping callback 'dense', as we already have a stdout callback.
Skipping callback 'full_skip', as we already have a stdout callback.
Skipping callback 'json', as we already have a stdout callback.
Skipping callback 'minimal', as we already have a stdout callback.