【发布时间】:2016-11-14 10:47:29
【问题描述】:
Ansible 版本:2.1.0
我的 ansible hosts 文件是:
[PM]
xyz.example.com ansible_connection=ssh
[ND]
pqr.example.com ansible_connection=ssh
[CM]
xyz.example.com ansible_connection=ssh
pqr.example.com ansible_connection=ssh
剧本是:
- hosts: PM:ND:CM
remote_user: root
tasks:
{some thing}
- hosts: PM
remote_user: root
tasks:
{some thing}
- hosts: ND
remote_user: root
tasks:
{some thing}
- hosts: CM
remote_user: root
tasks:
{some thing}
我正在使用以下命令运行剧本:
ansible-playbook --limit 'PM' akana-installation.yml
但剧本仍然在与所有主机一起玩,这意味着
Play 'PM:ND:CM'
Play 'PM'
Play 'ND'
Play 'CM'
所有戏剧都在播放。请帮我解决这个问题。
我需要的是:在执行剧本时我会给出组名,只有那个组才能玩,所以请告诉我还有其他方法吗。
【问题讨论】:
标签: ansible ansible-2.x ansible-inventory