【发布时间】:2019-03-23 06:23:23
【问题描述】:
我正在尝试为我的清单文件中提到的主机执行剧本中的任务,这些主机被分组在“Jira”下,但由于某种原因,我的组没有被识别为可以选择。文件内容请往下看。
如何使用清单中的所有主机运行剧本中提到的所有任务?
我有一个包含以下内容的 Inventory 文件:Hosts.yml
all: # the all group contains all hosts
hosts:
ansible:
ansible_host: #{ansible-controller}
ansible_user: root
crowd:
ansible_host: #{crowd}
ansible_user: root
jira:
ansible_host1: 53.31.54.56
ansible_host2: 53.31.54.55
我有内容的剧本:
---
- name: Install Jira Application
hosts: jira
gather_facts: true
become: true
remote_user: root
roles:
- ansible-preparation
#- jira-applicationsetup
我总是收到以下错误消息:
root@sedcagse0550:/usr/Anil/InfraAutomation/gsep-infrastructure-automation : ansible-playbook jira-fullinstall.yml
[WARNING]: Could not match supplied host pattern, ignoring: jira
PLAY [Install Jira Application] *************************************************************
skipping: no hosts matched
PLAY RECAP **********************************************************************************
如何对清单文件中提到的所有主机执行所有任务?
【问题讨论】:
-
这是一个问答网站,人们自愿来到这里为好问题提供答案。 (重复)在帖子中使用“任何人都可以”乞求无济于事,不会使您的问题更容易理解。正如this help 所表明的那样:只使用相关标签(否则你不妨包括
python、ascii/utf-8)因为这只会导致其他人在搜索这些标签时浪费时间搜索时找到您的(不相关的)问题。