我正在使用hosts
文件进行静态清单:
server1 ansible_ssh_host=1.1.1.1
server2 ansible_ssh_host=1.1.1.2
server3 ansible_ssh_host=1.1.1.3
[group1]
server1
server2
我有一个playbook,example.yml
的例子如下:
---
- name: base setup
become: true
hosts:
- group1
roles:
- base
我想运行一个使用example.yml
的ansible-playbook
测试,但是仅仅针对主机server1。有没有办法这样做?
-l SUBSET
also works like this-l "hostname_*"
which will find all hosts that start withhostname_
- John Hamilton